Last active
March 26, 2023 12:47
-
-
Save 3ru/b0223613b1293e8e3c42e924c8db2fa8 to your computer and use it in GitHub Desktop.
React p5 wrapper on Nextjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dynamic from 'next/dynamic'; | |
import { P5WrapperProps } from 'react-p5-wrapper'; | |
import { NamedExoticComponent } from 'react'; | |
const importReactP5Wrapper = async () => { | |
const module = await import('react-p5-wrapper'); | |
return module.ReactP5Wrapper as NamedExoticComponent<P5WrapperProps>; | |
}; | |
export const ReactP5Wrapper = dynamic(importReactP5Wrapper, { | |
ssr: false, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment