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

Question - Do we need to return doctype when using _document.js #1054

Closed
khrome83 opened this issue Feb 9, 2017 · 3 comments
Closed

Question - Do we need to return doctype when using _document.js #1054

khrome83 opened this issue Feb 9, 2017 · 3 comments

Comments

@khrome83
Copy link
Contributor

khrome83 commented Feb 9, 2017

Do we need to return doctype when using _document.js

<!doctype html> won't work in _document.js jsx. Throws error.

I see that we are appending it in server/render. Just want to check that when we use _document.js it is being included.

@nkzawa
Copy link
Contributor

nkzawa commented Feb 9, 2017

No, you don't, since with React, you can't create <!doctype html>. We automatically append it when you use _document.js too.

@nickdima
Copy link

nickdima commented Aug 4, 2017

Is there a way to avoid having the doctype by using a custom Document page?
I'm trying to use Next for rendering just some pieces of static HTML to be used somewhere else so I don't need to specify the doctype.

@khrome83
Copy link
Contributor Author

khrome83 commented Aug 4, 2017

I don't think so @nickdima.

You should probably handle this externally. After you generate the files, i would have some processing that strips out the pieces you do not want. You can do this in node.

If you check out the SSR Cache example, you can see how the HTML is rendered and then cached, no reason you can not process that string.

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants