Custom hook
See original GitHub issueEach connected component creates an extra component in the react tree.
A custom hook would be a better solution as storeon
already use hooks.
This could reduce bundle size and improve performance.
The connect
HOC could be an opt-in. It could use the custom hook underneath.
Thoughts on this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Building Your Own Hooks - React
Custom Hooks offer the flexibility of sharing logic that wasn't possible in React components before. You can write custom Hooks that cover a...
Read more >React Custom Hooks - W3Schools
Hooks are reusable functions. When you have component logic that needs to be used by multiple components, we can extract that logic to...
Read more >React: How to create a Custom Hook - Robin Wieruch
Custom Hooks consist of built-in React Hooks or other custom Hooks. Therefore a custom Hook is always a new composition of one or...
Read more >useHooks - Easy to understand React Hook recipes
We bring you easy to understand React Hook code recipes so you can learn how React hooks work and feel more comfortable writing...
Read more >How to create your own custom React Hooks
In React, a custom Hook is a function that starts with the word “use” and may call other Hooks. The “useWhatever” naming convention...
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 Free
Top 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
@hadeeb I copied
React.memo
API.connect(...args)(Component)
API requires more symbols from developer to use.react-redux uses this API because it was the API of ES decorators. But TC39 changed the decorator API again, so we do not need a reason to use this API anymore.
Renamed 06ccdd6
Waiting for TS update before making the release