Skip to content

Conversation

@sosukesuzuki
Copy link
Contributor

resolve #102

Caution

I installed [email protected] and @types/[email protected] ( and dependencies ) to use React Hooks.

@piotrwitek
Copy link
Owner

piotrwitek commented Jan 19, 2019

Hey, sorry for delay got a really tough week, I'll get to it tomorrow. Cheers!

Copy link
Owner

@piotrwitek piotrwitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks quite good! Just need to make a couple of fixes following the comments and we are good to go. Thanks!

"axios": "0.18.0",
"cuid": "2.1.1",
"react": "16.4.0",
"react": "^16.8.0-alpha.0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct all the added packages to use locked version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piotrwitek Sorry, I can't understand that what I should. How do I correct it to use the locked version?

Copy link
Owner

@piotrwitek piotrwitek Jan 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ^ prefix, everywhere you added them

}

interface Action {
type: string;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be an union, right now it's not type-safe

please declare:

type Action =
  | { type: 'reset' }
  | { type: 'increment' }
  ...

@sosukesuzuki
Copy link
Contributor Author

@piotrwitek I fixed the PR according to your review! please confirm:pray:

@piotrwitek
Copy link
Owner

Yeah, that looks great! Thanks for contribution.

@piotrwitek piotrwitek merged commit 86902ac into piotrwitek:master Jan 21, 2019
@sosukesuzuki sosukesuzuki deleted the hooks-use-reducer branch January 21, 2019 18:11
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.

Add useReducer hook with types example

2 participants