Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

ReactJS - HOC vs Twig/Laravel template

  • 19-09-2020 08:11PM
    #1
    Registered Users, Registered Users 2 Posts: 250 ✭✭


    Hi

    I have a fairly large web app I am working on (built in ReactJS) using SLIM/Propel for the backend. Currently I need to implement the user onboarding workflow (registration/verification/login), which brings me to my dilemma - I am stuck in that I cannot decide what is the best way forward. I have a fair amount of work done on the back end using SLIM for the Restful API, and Propel for the ORM, so I am very reluctant to do too much rewriting/porting due to time constraints.

    I think templating for security reasons is a good way forward, so I can either use Twig, or Laravel. Naturally I'd prefer to go the Twig route (because I have built a very slim TWIG scaffold that seems to authenticate well, and also there would be very little porting required). But from what I can find there seem to be a good few resources helping with integrating Laravel and React, but not so much Twig and ReactJS.

    Alternatively, I can skip TWIG/Laravel all together and stick to a pure ReactJS app, using HOC components for pre-and-post authentication activities, but I don't know if this is a good way forward.

    Any advice would be appreciated.


Comments

  • Registered Users, Registered Users 2 Posts: 417 ✭✭spaceCreated


    Would it not be handier to just use something like react-router and a normal authentication flow to protect the routes & components? I'm not sure exactly what you mean by templating though.

    (I'm trying not be pedantic but HOC stands for higher order component, so no need to say HOC components)


Advertisement