Answer the question
In order to leave comments, you need to log in
How to transfer a project to React (on a Bitrix project)?
At the moment, the project uses: native js, bitrix (and php of course)
We don’t like how the frontend and backend interact now (front and back are in different repositories and we want everything to be in one place. If something changes on the front, then we have to transfer compiled js and css files, which is inconvenient for us)
We are thinking how to optimize the work of the frontend and backend.
There was a proposal to translate the project to React.
I think how to do it, because writing a react project from scratch is one thing, but it seems to me that converting an existing project to react is another.
I don't have a full idea of how it will be yet. There are a lot of weird things.
1) For example now, the data is rendered using php.
But if we transfer the project to react, how will we write php in it?
After all, the react syntax ( jsx ) does not provide for php.
And there are sections that you don’t even want to touch - just copy php and paste. But how does this happen in React?
2) And one more thing: the project is quite large. And it seems to me that it’s not so easy to take a week and transfer the project to React. Probably we will translate parts.
Those. it turns out that one part of the project will be written in react, and the other will not? How is that at all?
Anyone have similar or similar experience? What do you advise? How to competently transfer the project to react in this case?
Answer the question
In order to leave comments, you need to log in
But if we transfer the project to react, how will we write php in it?
That's right, the person above wrote. I will add. Your Bitrix component templates must provide initial data for subsequent rendering of the page on the client side. I am not familiar with React, but I suspect that it receives data via json. Those. the task boils down to the fact that the template of the Bitrix component gave json, and React understood it. Create a new site template, without visual data, and include it with a GET condition, for example react=Y. And read the comment above.
We do not like how the frontend and backend interact now (front and back are in different repositories and we want everything to be in one place.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question