Go Pro Sign Up Login
0 days 0 hrs 0 min 0 sec

Summer Sale

50% off Level Up Pro until you unsubscribe.
Get access to ALL 128 courses on Level Up Tutorials

This is your last chance to get Level Up Pro for $145/year.

or Learn More
Moon Moon

Buy Now and unlock this series

$

49

.99

$

24

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

Creating Custom Hooks

Downloads

Become a pro to download code and videos

Comments

User avatar

dave.js

over 2 years ago

@Mike Connor Returning the array means that useTitleInput has the same interface as useState. It's hard to say what your error is without seeing your code, but if you return [value, setValue], you should be able to access those items like so:

const [name, setName] = useTitleInput('');

Mike Connor

almost 3 years ago

Why return [value, setValue]? In the docs, I'm just seeing 'return value'.... and your way is giving me an error

Want to join the conversation?

Become a Pro member today!