5

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.

1 Answer 1

6

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 was completed. You can simply enable the Concurrent Mode (Experimental) by 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 />)

NOTE: You can learn more about how to enable this feature properly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.