react-live
react-live copied to clipboard
Require is not defined error in Next JS
When I try to import a thing the error comes "require is not defined".
const exampleCode = ` import FAQ from './FAQ'
const LoginComponent = () => {
const [showPreview, setShowPreview] = React.useState("Hi");
return (
<div>
<h3 className="bg-red-500">
Login Component<br/><br/>
{showPreview}
<FAQ/>
</h3>
</div>
)
} render(<LoginComponent />) `;