Skip to content

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

Merged
merged 15 commits into from
Nov 13, 2020
Merged

feat/useToggleValue #1019

merged 15 commits into from
Nov 13, 2020

Conversation

mendyEdri
Copy link
Contributor

Description

Introducing new utility hook to easily control any toggled values

Changelog

Introducing useToggleValue to toggle between any tow values with ease!

@mendyEdri mendyEdri changed the title Feat/use toggle value feat/useToggleValue Nov 3, 2020
@mendyEdri mendyEdri requested a review from ethanshar November 3, 2020 12:16
@@ -0,0 +1,23 @@
import {useState, useRef} from 'react';
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@mendyEdri mendyEdri requested a review from ethanshar November 9, 2020 08:49
@ethanshar ethanshar merged commit bcd9c9f into master Nov 13, 2020
@mendyEdri mendyEdri deleted the feat/useToggleValue branch November 16, 2020 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants