Working with Data in Hooks
Learn how to pass data in custom Hooks and return the response to the component that called the Hook.
Passing data via custom Hooks
Passing data via custom Hooks is not a one-way street. In our first custom Hook example, we’ve seen that we can pass data into a custom Hook as a function parameter. The Hook can also return data that can then be used in the component. The form in which this data is returned from the Hook is entirely at the developer’s discretion. You can easily return strings, ...