Repository navigation
Custom document support - #405
Merged
Merged
Conversation
1 similar comment
nkzawa
commented
Dec 16, 2016
|
|
||
| await Promise.all([ | ||
| runCompiler(compiler), | ||
| babel(dir) |
Contributor
Author
There was a problem hiding this comment.
We have to do a specific babel compilation instead of using webpack and babel-loader for pages/_document.js since the file is used only on server side.
nkzawa
commented
Dec 16, 2016
| } | ||
|
|
||
| render () { | ||
| const { head, nextCSS } = this.context._documentProps |
Contributor
Author
There was a problem hiding this comment.
Head, Main and NextScript receive props of Document via context so that you don't have to manually set props to these components. This should be convenient but can be too obscured ?
Member
There was a problem hiding this comment.
No. I think context is the right thing to use here.
Member
|
Amazing |
|
Great! Question, in my custom , the comments says the following : Is that true, the is SSR only? |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #251
See https://github.com/zeit/next.js/wiki/Roadmap#custom-css-solutions-custom-document
This PR supports:
next/csswith any CSS librarypages/_document.jsDocumentcomponent and some useful components (next/document)Usage
Create a file on
pages/_document.jsWIP
Add
khan/aphroditeexampleAdd tests