Comments (3)
Thanks for reporting this! We dug into this a little bit but couldn't reproduce on our end. By the looks of this, I suspect it might be something related to the way v4 worked (i.e. attempting to render to the root document).
Could you try clearing out your build folder and checking to see if the components in your current setup are doing this? It could also be helpful to have an example of what you have in the component that you're rendering and in the _app.js
file, if that's being used
from x0.
Of course! I forgot to mention also that we are running version 5.0.8. FWIW I ended up just adding a <head>
with all the information we needed into _app.js and that seems to be working fine as a work around. I'll still post our _app.js and Index component here in case anyone else runs into this in the future!
Here's what our _app.js
file looked like:
import CSS from './CSS'
import React from 'react'
import Index from './docs'
// Generic page wrapper component
const Page = ({ render }) => (
<React.Fragment>
<head>
<CSS />
<div className='text-dark-gray'>
<Index />
</div>
</React.Fragment>
)
export default Page
And here's that Index
component:
const Index = props => (
<div>
<nav className='UnderlineNav'>
<div className='UnderlineNav-body'>
<NavLink to='/docs/primer-react' className='UnderlineNav-item no-underline' activeClassName='selected'>primer-react</NavLink>
<NavLink to='/docs/demos' className='UnderlineNav-item no-underline' activeClassName='selected'>Demos</NavLink>
<NavLink to='/docs/sandbox' className='UnderlineNav-item no-underline' activeClassName='selected'>Sandbox</NavLink>
</div>
</nav>
<Route path='/docs/demos' component={DemoPage} />
<Route path='/docs/primer-react' component={ComponentPage} />
<Route path='/docs/sandbox' component={Sandbox} />
</div>
)
from x0.
Thanks! I'm not seeing anything that looks like it'd be duplicating the <head>
in the index.js
file. And just to double check the filename is (lowercased) index.js
, right?
Generally I'd suggest not putting a <head>
element in the components with the way v5 is setup. The app renders to the root
div here with the default template: https://github.com/c8r/x0/blob/master/lib/template.js#L23 I would like to add support for a <Head />
component that could be used like the example above, but we don't have that feature yet.
FWIW, another alternative to adding head options in the package.json is to supply a custom template
from x0.
Related Issues (20)
- s
- Expose @mdx-js/loader configuration
- Is there a way to pass params to the router? HOT 2
- No way to extend webpack-server options HOT 5
- Bundle misses modules HOT 19
- buble and react-live problems
- v7 release HOT 1
- Build creates wrong links HOT 2
- Nested anchor tags HOT 1
- LiveEditor with Custom Component/ScopeProvider example?
- Update babel dependencies HOT 2
- Opportunity to decrease package install size
- New install fails with: "Uncaught TypeError: Cannot set property 'jsx' of undefined" HOT 3
- localhost not working HOT 2
- Hooks Invariant Error, as ReactSharedInternals is unable to be set (Static Website Only) HOT 1
- Future of the project HOT 2
- Dead link for the blog post
- How to execute getInitialProps in node only HOT 2
- NODE_ENV is always set to "development"?
- Does X0 works on windows 10? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x0.