-
Notifications
You must be signed in to change notification settings - Fork 734
feat/useToggleValue #1019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/useToggleValue #1019
Conversation
…toggle between any two values
src/commons/useToggleValue/index.ts
Outdated
@@ -0,0 +1,23 @@ | |||
import {useState, useRef} from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a little mess with the "commons" path and what we export there, also after TS it got a little messier due the commons/new
file we had to add.
So till we sort that mess I think it will be better to move our hooks into a different hierarchy, so what about keeping it under src/hooks
?
Also, I'm considering if we should export each hook as a standalone or export them under "Hooks" namespace?
So instead of the user import like this
import {useToggleValue} from 'react-native-ui-lib`
They will
import {Hooks} from 'react-native-ui-lib`
const {useToggleValue} from Hooks;
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it!
On it
Description
Introducing new utility hook to easily control any toggled values
Changelog
Introducing
useToggleValue
to toggle between any tow values with ease!