Expose a decorator function for Redux containers.
See original GitHub issueI propose exposing an additional function that returns the given component wrapped with the error boundary component. Much like connect()
from the react-redux
api.
When exposing the class alone, it lends it’s self to wrapping a component in JSX which isn’t a good fit in some scenarios. For example if a Redux container is referenced in a React Router route as a component reference there is no nice place to use this lib.
With a function as described we could do the following in our redux continers:
export default connect(mapStateToProps, mapDispatchToProps)(
withErrorBoundary(Component, FallbackComponent, errorHandler)
)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
testing state on decorated components · Issue #98 - GitHub
Is there a way to achieve the dual-export of a pure component and connected component using the @connect decorator syntax?
Read more >The elegance of decorated Redux - CloudBoost
I prefer using decorators, because it allows me to write elegant and maintainable code. @connect({ mapStateToProps, mapDispatchToProps }) export ...
Read more >Reducing our Redux code with React Apollo
This function returns an object with properties like variables , which supplies your variables to your query, and pollInterval , which allows ...
Read more >Using recompose to achieve better separation of concerns in ...
Use recompose and higher order components to enhance functional components; Add new decorators to a composed decorator, keeping them small and ...
Read more >React-Redux - Using multiple container decorators
New! Save questions or answers and organize your favorite content. Learn more. ... I have 3 containers: ... Each have their own page...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just published 1.2.0 with support for
this
but you’ll need to switch away from arrow function to a regular function if you want to use it.Get it, thanks for your great work again. ^_^