Closed julbrs closed 4 years ago
Hi, I don't really see the link between react app and Symfony in this example... how are we supposed to consume entity from the react app? Other minor comment, I think npm is easier to use in React project :)
I don't know if npm is easier, but I always used yarn... :)
I have some doubts in this too @StaudenmannM...
how are we supposed to consume entity from the react app
Are we going to do an AJAX requisition?
I don't know if npm is easier, but I always used yarn... :)
me too :D
https://www.reddit.com/r/reactjs/comments/9ypfd8/why_does_createreactapp_use_yarn/
We can switch to npm
!
@StaudenmannM @analuspi can we meet for that I will show you !
Read the doc in
docs/dev.md
There is now 2 console to run in order to develop with reactJS on this project:
bin/console server:run
to start the serveryarn encore dev --watch
to build the react component for rendering in templateThere is a react app already developed in the project:
webpack.config.js
we define the appapp
in the file./assets/js/app.js
app.js
(you can create component, etc)Test the app in the
Contact
page (underMore
)(yeah I know it is a really simple app. but we can imagine consume any data from the Entities for example)
We can :
It allow to do react when and where we want. It allow to migrate part by part the existing webapp to react if we want to go to a single react app / single page application.