-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
adding types order, moved types to package #52
Conversation
created canary release to test this MR -> 0.9.0-canary.2 |
|
||
export type Hoc<S> = { store: HookReturn<S> }; | ||
|
||
type HocFunc<S, R extends React.ComponentClass = React.ComponentClass> = ( |
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.
wondering if we should type the R as
R extends React.ComponentType
as the ComponentType would cover both React.FunctionComponent<> | React.ClassComponent<>
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.
Our advice is to use the useStore
hook rather than the withStore
HOC whenever it is a functional component. So I don't think it's wrong to have only the React.ClassComponent
. In which cases would it make sense to use the withStore
in a functional component?
If there is some sense that we didn't take into account then I think it's okay to change it. 🤔
minor comments but rest looks good |
Co-authored-by: Aral Roca Gomez <aral-rg@hotmail.com>
@all-contributors please add @danielart for code |
@danielart already contributed before to code |
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[ ] Bug fix
[ ] New feature
[x ] Other, please explain: Add types d.ts
What changes did you make? (Give an overview)
add types based on proposition at issue #23
Which issue (if any) does this pull request address?
Is there anything you'd like reviewers to focus on?
types, test it, edge cases