With CLI There are two ways to use a React library in Magento 2.
1) Using CLI The CLI (Command Line Interface) is the way you’ll do most of your React work with Magento. This is the preferred method of learning and learning Magento. Magento 2 CLI is still under development and needs some serious bug fixing. It’s easy to build your first application using the CLI, but you’ll want to be aware of these common pitfalls: The CLI is not extremely reliable. Some basic CLI commands don’t work as expected. A CLI application can be difficult to debug. To learn more about the CLI, check out this learning guide.
2) Using Yarn When it comes to Magento 2 development, a few new features have been added which make it much easier to use a library with Magento. The first new feature is that you can now link your project to a yarn repository which provides all the dependencies you need to install in Magento. Additionally, Magento 2 now ships with a small example project which demonstrates how to use a library. Here’s a screen shot of the example project: Another nice thing about Magento 2 is that you can now install libraries using Yarn.
What is React Library In Magento 2?
As I said above, there are several ways to use React in Magento 2, which you can check here. However, I have to say that, if you’re building a Magento 2 eCommerce site, it is better to use the standard one. This means, that you don’t need to replace the existing Angular code in the module. The thing is, the Angular framework itself doesn’t have any directives.
How easy To Use React Library In Magento 2