-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
React ref is always null with script tag inside Head component #20850
Comments
As a workaround, I am using |
It is expected that refs do not work when rendered in |
I also noticed that |
Same reason: #20850 (comment) |
Please verify that your issue can be recreated with Why was this issue marked with the
|
This issue has been automatically closed because it wasn't verified against next@canary. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
10.0.5
What version of Node.js are you using?
14.15.3
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
next dev
Describe the Bug
When using react
ref
with script tag inside next jsHead
component, theref.current
is always nullExpected Behavior
I expect that
scriptRef.current
will hold a reference to the script elementTo Reproduce
scriptRef.current
is null and it is indeedThe text was updated successfully, but these errors were encountered: