Skip to content

Instantly share code, notes, and snippets.

@3ru
Last active March 26, 2023 12:47
Show Gist options
  • Save 3ru/b0223613b1293e8e3c42e924c8db2fa8 to your computer and use it in GitHub Desktop.
Save 3ru/b0223613b1293e8e3c42e924c8db2fa8 to your computer and use it in GitHub Desktop.
React p5 wrapper on Nextjs
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