Can I use Next 10 with React 16?

Viewed 1280

The Next.js 10 Upgrade Guide has a section titled React 16 to 17.

However, it does not say if Next 10 is compatible with React 16 or not.

package.json has React 17 in the dependencies list:

"react": "17.0.1",
"react-dom": "17.0.1",

Does it mean Next 10 is incompatible with React 16?

My particular case is that I must use a UI library that is not compatible with React 17 and only works with React 16. In the same time, I'd like to leverage some features of the latest Next. What are my options?

1 Answers

You can use Next.js v10 with either React 16 or 17.

React is a peer dependency in Next.js (check the peerDependencies in its package.json to see the supported versions). Next will use the version you have installed in your project.

Related