12 Matching Annotations
- Oct 2020
-
final-form.org final-form.org
-
Doing a HOC properly, as a library should, with hoisted statics and displayName and ref, etc., is a hassle and would add unnecessary bulk.
-
-
github.com github.com
-
codesandbox.io codesandbox.io
-
// Make a HOC // This is not the only way to accomplish auto-save, but it does let us: // - Use built-in React lifecycle methods to listen for changes // - Maintain state of when we are submitting // - Render a message when submitting // - Pass in debounce and save props nicely export default props => ( <FormSpy {...props} subscription={{ values: true }} component={AutoSave} /> );
-
- Dec 2019
-
github.com github.com
-
return <Lower
Interesting naming convention: Higher and Lower components.
-
-
- Nov 2019
-
www.robinwieruch.de www.robinwieruch.de
-
However, in this case you would lose the possibility to render something in between. You are strictly coupled to the higher-order component's render method. If you need to add something in between of the currency components, you would have to do it in the higher-order component. It would be quite similar as you have done it previously by rendering the currency components straight away in the Amount component. If using a render prop component instead, you would be flexible in your composition.
-
For the sake of completeness, the following code demonstrates that the problem could be solved with a higher-order component (HOC) as well:
-
- Oct 2019
-
github.com github.com
-
github.com github.com
-
We've extracted some key features into separate HOCs to keep the main library as small as possible
-
- Sep 2019
- Aug 2019
-
legacy.reactjs.org legacy.reactjs.org
-
logProps
Outputs old and new props whenever component updates.
-