Documentation
React
Usage Inside Next.js

Usage Inside Next.js

💡
<For /> and block() are currently not supported within Next.js.

You can use Million inside Next.js by using the dynamic function from next/dynamic to load the component without Server-Side Rendering (SSR).

Similarly, you can use the utilities provided for React, with the exception of <For /> and block().

_app.js
import dynamic from 'next/dynamic';
// Note that blocks currently cannot be prerendered because it
// is dynamically imported.
const Block = dynamic(() => import('million/react'), { ssr: false });
 
function Hello({ name }) {
  return <h1>Hey there {name}</h1>;
}
 
function App() {
  return (
    <>
      <Block name="Million">{Hello}</Block>
    </>
  );
}
 
export default App;