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

Enable custom wrapping of top-lvl React component #77

Closed
Martinsos opened this issue Oct 13, 2020 · 3 comments · Fixed by #1009
Closed

Enable custom wrapping of top-lvl React component #77

Martinsos opened this issue Oct 13, 2020 · 3 comments · Fixed by #1009
Assignees
Labels
enhancement New feature or request

Comments

@Martinsos
Copy link
Member

If Wasper wants to, for example, add Redux to their app, they will want to wrap the top-lvl React component into Provider for Redux. In that case, they will need some kind of mechanism to do that -> it could be a JS function that receives top lvl component and returns the same component but wrapped into whatever they like -> basically a decorator.

@Martinsos Martinsos added the enhancement New feature or request label Oct 13, 2020
@Martinsos Martinsos self-assigned this Jul 19, 2021
@Martinsos Martinsos assigned faassen and unassigned Martinsos Jan 24, 2022
@faassen
Copy link
Contributor

faassen commented Feb 8, 2022

I'm quite interested in how we design this one, but I won't get around to it soon so unassigning.

@faassen faassen removed their assignment Feb 8, 2022
@Martinsos
Copy link
Member Author

Suggestion by @infomiho

Do we offer an escape hatch like _app.js in Next.js 12? That would be an ideal place such a thing.

  1. If there is a user provided App component then use it as wrapper around router
function App({ children }) {
  return (<ChakraProvider>
{children}
</ChakraProvider>);
}
  1. Else provide just a function App(props) { return props.children; } (edited)

@Martinsos
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants