andyrichardson / fielder

A field-first form library for React and React Native
https://fielder.andyrichardson.dev
MIT License
196 stars 10 forks source link

Where does useMemo come from? #266

Closed patikanji closed 4 years ago

patikanji commented 4 years ago

There is no mention in the guides, but exists in sample codes.

andyrichardson commented 4 years ago

Hey @patikanji, useMemo is provided by React as part of the hooks API. You can find out more about it here.

The reason you want to memoize your validation function is so that Fielder can work out whether the validation function has changed or not.

patikanji commented 4 years ago

@andyrichardson Thanks. I just come to react world (via NextJS) after years oh PHP. It seems promising to use fielder since I often work with long and complex forms.

andyrichardson commented 4 years ago

No worries @patikanji :+1:

Definitely check out the official docs for React, they're a really strong source!

As for Fielder, here are some examples and a tutorial video to help you get started.

patikanji commented 4 years ago

Sure @andyrichardson. I'm reading the doc right now after watching your video in my Flipboard feeds.