I would like to test React concurrent mode, and still using create-react-app? Is it possible?
I have check create-react-app documentation, and also looks for a specified NPM module, and didn't found.
I would like to test React concurrent mode, and still using create-react-app? Is it possible?
I have check create-react-app documentation, and also looks for a specified NPM module, and didn't found.
Well, the short answer is yes. All you have to do is to create your new app with CRA like this:
npx create-react-app myapp
Then after the main installation got completed. You can simply enable the Concurrent Mode (Experimental), with adding it to your project (You have to make sure the current version of react is supporting this experimental mode):
npm install react@experimental react-dom@experimental
# or: yarn add react@experimental react-dom@experimental
Then simply you can change the index.js
root element with replacing ReactDOM.render(<App />, rootEl)
with:
const root = ReactDOM.createRoot(rootEl)
root.render(<App />)
You can learn more about how to enable this feature properly here.