-
Notifications
You must be signed in to change notification settings - Fork 65
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
_app.js: render function or Component, and MDX access to props #86
Comments
To expand on the second question. Consider this // _app.js
import React from 'react';
const App = props => {
const { render } = props;
return (
<React.Fragment>
{render({ foobar: 12345 })
</React.Fragment>
);
};
export default App; And now this MDX file under the doc root:
|
Either |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the README, the Custom App section talks about using the
render
function to pass props to child routes.In the equivalent page in the nicely formatted doc there's no mention of using this
render
function. It mentions usingComponent
instead.Which approach should we be using?
And also, the reason I went down this hole: I can use
_app.js
to pass props to child routes. I can access these props in JS files: they're provided to the React component exported from the file.How do I access these props in MDX files?
The text was updated successfully, but these errors were encountered: