On my team I'm working as a frontend developer in a React codebase. We're building an application and do everything in React. Before this I was actually always a backend developer. Now I have the feeling that in most "backend" frameworks it's quicker to just generate a view with a template engine instead of connecting everything through REST api's.
So I started thinking about an alternative approach to write React, because I have the feeling I'm way slower writing in javascript only. But I still want to keep the advantage dynamic components.
The ReactDOM.render
method is the part that connects the dom with the component.
I would still render serverside most stuff and the dynamic stuff I would build into components and then render them with the ReactDom.render
method.
By doing this I still keep the development speed of building/generating pages on the backend while I get the advantage of the React stack to build sophisticated dynamic components.
This method could even be possible for front end projects only. If you build your site statically (layout, pages, static content, ...) and then the dynamic content API stuff you just do in React.
So what do you people think? What are the (dis)advantages of this approach? And would it be more efficient?
I'm assuming that the team members were I would implement this strategy are both knowledgeable of the backend and the frontend.