-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
Dependency Footer Scripts #1105
Comments
If you are looking for this, that's possible: export default class extends Document {
render() {
return (
<html>
<Head />
<body>
<Main />
<NextScript />
<script src="your location" />
</body>
</html>
);
}
} |
No. I mean by including a script tag in a component and having next inject it below next script.
The layout or document could be used for multiple pages, so I only want the script attached if the component using that script is rendered.
…On Feb 13, 2017, 8:55 PM -0600, Arunoda Susiripala ***@***.***>, wrote:
If you are looking for this, that's possible:
export default class extends Document { render() { return ( <html> <Head /> <body> <Main /> <NextScript /> <script src="your location" /> </body> </html> ); } }
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#1105 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ABwmA1u1RzB5EA6TO_XpNdcmvUhV9iIzks5rcRe6gaJpZM4L_MXl).
|
@khrome83 Normally react don't allow you to use script tags. Then it loads after |
Understood. I guess in my mind I was thinking of something along the lines of how we use
Then in the
Thoughts? The idea is that if I have 20 pages, and I am using something on two of those pages. I should only have the |
@khrome83 something like Check these solutions: https://goo.gl/Z1Dxsq |
@arunoda - sorry i just saw this very late. If you have time, would you be able to link the solution you were trying to share. The tiny google url apparently timed out. |
Question:
Originally I was considering to use
<Head>
to load a polyfill if a specific component configured in a specific way.Is there a way to say to inject a script to be included with the
<NextScript />
block from within another component. The same way that we include a script within the head.An example -
I built a image component that can also be a responsive image using
srcset
andsizes
. I want to include thepicturefill.min.js
library if either of these attributes are not undefined.The text was updated successfully, but these errors were encountered: