Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

export type Setter in use-global.d.ts #155

Closed
rolandzwaga opened this issue Mar 28, 2020 · 2 comments
Closed

export type Setter in use-global.d.ts #155

rolandzwaga opened this issue Mar 28, 2020 · 2 comments
Assignees
Labels
feature A new feature is requested.
Milestone

Comments

@rolandzwaga
Copy link
Contributor

Is there a reason why the Setter type is not exported in use-global.d.ts?

I'm passing the setter to a child component and would like to strongly type the prop, but currently that's not possible since that type isn't exposed.

@quisido
Copy link
Collaborator

quisido commented Mar 29, 2020

It was never expected to be passed around between components, since it is global state. The child would be able to useGlobal() to generate the same function without a prop.

It's pretty safe, so I don't have any opposition to exposing it.

You are welcome to open a pull request to resolve this issue; or if you aren't comfortable doing that, please confirm that the child calling useGlobal itself does not address your use case, and I'll try to make the commit this week.

@quisido quisido added the feature A new feature is requested. label Mar 29, 2020
@quisido quisido self-assigned this Mar 29, 2020
@rolandzwaga
Copy link
Contributor Author

ok, PR sent, thanks mate, I love the library by the way, use it a lot

@quisido quisido added this to the 2.2.7 milestone Apr 4, 2020
@quisido quisido mentioned this issue Apr 4, 2020
@quisido quisido closed this as completed Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature A new feature is requested.
Projects
None yet
Development

No branches or pull requests

2 participants