Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextjs ref is always null #46

Open
mwaqarkt opened this issue Oct 19, 2023 · 0 comments
Open

Nextjs ref is always null #46

mwaqarkt opened this issue Oct 19, 2023 · 0 comments

Comments

@mwaqarkt
Copy link

mwaqarkt commented Oct 19, 2023

Hi,

I am using dynamic load for the flipbook component.
I tried different ways to get ref working but it is always null.
Need help.

I am using it as client rendering so used this command as well
'use client';
Three different ways to import are given below

`const HTMLFlipBook = dynamic(() => import('react-pageflip'), {
ssr: false,
loading: () => {
setIsFlipPageLoaded(false);
return

....Loading...

;
},
loaded: () => {
console.log("Loaded");
setIsFlipPageLoaded(true);
},
forwardRef: true
});

const ForwardedRefHTMLFlipBook = React.forwardRef((props, ref) => (
<HTMLFlipBook {...props} forwardedRef={ref} />
))

const HTMLFlipBook = Loadable({
loader: () => import('react-pageflip'),
loading: LoadingComponent,
});`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant