final-form / react-final-form-hooks

React Hooks to bind to 🏁 Final Form's high performance subscription-based form state management engine
MIT License
471 stars 19 forks source link

Performance via referential equality on useForm functions #30

Open mrjackdavis opened 5 years ago

mrjackdavis commented 5 years ago

Are you submitting a bug report or a feature request?

feature request (or more like a performance request)

What is the current behavior?

onBlur, onChange and onFocus from useForm(...).input do not maintain referential equality between renders. Therefore React.memo is hard to correctly implement.

What is the expected behavior?

Preferably the aforementioned functions (onBlur, onChange and onFocus) would be referentially equal between renders.

What's your environment?

"react-dom": "16.8.2"
"final-form": "^4.11.1"
"react-final-form-hooks": "^1.0.0"

Other information

mrjackdavis commented 5 years ago

Hi, This is something I'm interested in writing a PR on. But I'm finding it difficult to properly setup a development environment. Are there any dev-docs I can reference?

erikras commented 5 years ago

Great insight. 👍

The dev stuff can be hard, as we currently have no test suite. I've had some success in the past consuming a library as I write it using yalc. Good luck? 😄

mrjackdavis commented 5 years ago

Good luck?

😆