I want to learn reactJS is it dependent on a certain backend?
Also, is it possible to use reactJS as frontend then PHP and MySQL for the backend?
I want to learn reactJS is it dependent on a certain backend?
Also, is it possible to use reactJS as frontend then PHP and MySQL for the backend?
Absolutely! The best approach is to write an API in PHP to pass the MySQL data to javascript via REST endpoints. Like this:
https://code.tutsplus.com/tutorials/how-to-build-a-simple-rest-api-in-php--cms-37000
Then use HTML and Javascript to build a react frontend that would access this data. You'd probably want to use a built tool like webpack or even a framework like next.js to compile your javascript and do nice things like code splitting and tree-shaking.
In the above case, they would be two separate code bases. One for the API and one for the frontend. But react is actually very adaptable and you can run any react component on any page very easily using ReactDOM here is an intro:
https://reactjs.org/docs/add-react-to-a-website.html
with this you can put a react component on any existing php website and either build out specific endpoints to populate data or even just fill a <script> tag with JSON and read it with useEffect or componentDidMount
I want to learn ReactJS, is it dependent on a certain backend?
No, it's not. It depends on your project needs and preference.
Is it possible to use ReactJS as frontend, then PHP and MySQL for the backend?
Yes, of course. You can build a backend with PHP using a framework like CodeIgniter, or Laravel, or vanilla PHP, and build your API and serve your React App with the data.
Or you can use Node.js for the backend, or Java spring boot, or .NET, or any backend language. Just build a good REST API and use the language that fits your project. There is a lot more to say.
Of course, it's possible to use PHP with ReactJS, and I'm not just referring to having two separate layers for implementation (i.e., the API (Backend) layer and ReactJS as a separate frontend layer).
What I mean is that PHP and ReactJS can be combined and shipped in a single application package, much like one would work with vanilla JS or other common front-end tools like jQuery, Bootstrap, etc. I even wrote an article on how to achieve this: PHP and ReactJS: Combined.
I've also gone as far as writing a minimal PHP framework that uses ReactJS as its view handler - called Mimosa.
Note: Just to provide some insight, any npm module that can work via a CDN URL is likely to work with PHP out of the box. To find out which modules you can use over CDN, you can refer to Skypack.