A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://symfony.com/doc/current/frontend/encore/reactjs.html below:

Enabling React.js with Webpack Encore (Symfony Docs)

Screencast

Do you prefer video tutorials? Check out the React.js screencast series.

Tip

Check out live demos of Symfony UX React component at https://ux.symfony.com/react!

Using React? First add some dependencies with npm:

1
$ npm install react react-dom prop-types --save

Enable react in your webpack.config.js:

1
2
3
4
5
6
7
// webpack.config.js
  // ...

  Encore
      // ...
+     .enableReactPreset()
  ;

Then restart Encore. When you do, it will give you a command you can run to install any missing dependencies. After running that command and restarting Encore, you're done!

Your .js and .jsx files will now be transformed through babel-preset-react.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4