-
Notifications
You must be signed in to change notification settings - Fork 646
fix react errors #72
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
fix react errors #72
Conversation
- move page cruft to app component - move meta to package.json
|
These build fails look like nothing to do with this pr 🤔 |
|
Yeah, I ran into these build errors in #65 after upgrading to v5. My guess is that one of the Kit components (LiveEditor? we're not even using it, though) uses brace, but webpack isn't liking it in a non-browser environment, as reported in thlorenz/brace#30. Tree-shaking should prevent this from being imported if it's not being used, but there may be somewhere that it's used in Kit that prevents it from being "shaken". I'll file an issue there and see if the maintainers have any ideas. |
shawnbot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failing build aside, this looks great! 👍
|
Build failure issue: c8r/kit#189 |
|
Heads up I'm going to update x0 to pull in that fix for the build failure and then merge this in. |
| import React from 'react' | ||
|
|
||
| // Generic page wrapper component | ||
| const Page = ({ render }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this component still wrap Library components in places like index.js? Curious about how this is used
|
Also curious what the |
|
@emplums 👉👃 (I have |
|
Lol sorry, setting up vim for you know who 😑 |
|
@shawnbot I updated the latest version of Kit to pull in the fix for the build fails, and they've passed 🙌 |
emplums
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! I just left one question about how _app.js should be used - do we need to import that anywhere that we'd like a Page to be? Or is the _app.js namespace something that works automagically with Kit?
|
@emplums It looks like |
Good question! import React from 'react'
import { NavLink } from 'react-router-dom'
export default class extends React.Component {
render () {
const { render, routes } = this.props
return (
<div>
<nav>
{routes.map(route => (
<NavLink
key={route.name}
to={route.path}>
{route.name}
</NavLink>
))}
</nav>
{render()}
</div>
)
}
}The custom app component is part of x0, not Kit. Here are the docs https://github.com/c8r/x0#custom-app |
This fixes some of the local react errors we were getting. I also upgraded x0 and Kit to latest version.
x0 v5 renders inside the body, so the head and body tags need to be pulled our of the rendered app, this was fixed by: