guywatson

Hi there

So i've built a front end using react and communicate with the SilverStripe CMS using graphql. Has anyone tried taking the react MFA form from the module and using it on their own react frontend? Could anyone give me pointers on where i should start please 🙂

robbieaverill

Hey! You can use the React Injector's inject() HOC to provide components to your own React components, so if you need parts of the MFA views etc then you can import them into your code that way. If that is too much work I'd probably suggest you essentially fork the MFA codebase and bring it all into your own code. Ultimately the MFA frontend code is there as a default implementation, and to provide inspiration for others who may want to have their frontends build with Vue.js or something other than React.

guywatson

Thanks for your suggestions. You've given me somewhere to start. Really appreciate it 😊

👍 (1)
robbieaverill

Hey @cameron, the way SilverStripe uses React is really only for the CMS. You're free to use anything you want on your frontend. If you want to use React I'd suggest reading the React tutorials (they're great) and then maybe have a look at how to use GraphQL with React, then go for it. You might also want to pre-render your pages, there are a bunch of tools that will help with that but @unclecheese has written a plugin for Gatsby which might save you some time: https://github.com/silverstripe/silverstripe-gatsby

cameron

i'm new at react, whats a good starting point for using it in the front end?