packages/docs/docs/react-18.mdx
To use React 18's newest features, you need at least version 3.0.0 of Remotion.
- "remotion": "2.6.15"
- "@remotion/bundler": "2.6.15"
- "@remotion/cli": "2.6.15"
- "@remotion/renderer": "2.6.15"
+ "remotion": "3.0.0"
+ "@remotion/bundler": "3.0.0"
+ "@remotion/cli": "3.0.0"
+ "@remotion/renderer": "3.0.0"
You need to upgrade both react and react-dom:
- "react": "17.0.1"
- "react-dom": "17.0.1"
+ "react": "18.2.0"
+ "react-dom": "18.2.0"
If you use TypeScript, update to the newest types as well:
- "@types/react": "17.0.3"
+ "@types/react": "18.0.0"
Run npm i, or yarn, or pnpm i afterwards, matching your package manager.
React.FC typesThe types for React.FC have changed to no longer include children. If you get a type error, change
const MyComp: React.FC = ({ children }) => <div>{children}</div>;
to:
const MyComp: React.FC<{
children: React.ReactNode;
}> = ({ children }) => <div>{children}</div>;
createRoot()If React 18 is installed, Remotion will automatically use createRoot() from react-dom/client instead of render from react-dom. You don't need to do anything.