Skip to content
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

Improve typings #51

Merged
merged 1 commit into from
Jul 1, 2019
Merged

Improve typings #51

merged 1 commit into from
Jul 1, 2019

Conversation

nartc
Copy link
Contributor

@nartc nartc commented Jun 30, 2019

Remove any

@nartc nartc closed this Jun 30, 2019
@nartc
Copy link
Contributor Author

nartc commented Jun 30, 2019

Fix and improve getPageItemProps. getPageItemProps now will receive the correct HTMLElement type when used on an HTMLElement. The screenshots show getPageItemProps gets HTMLAnchorElement when used on an a tag and HTMLButtonElement when used on a button tag.

image
image

This PR also fixes a couple of typings bugs:

  1. getPageItemProps will need to return props instead of void.
  2. For hooks, React.SFC is deprecated since FunctionComponent are no longer considered Stateless because they can use Hooks to have internal States.

PageItemProps is also exported to be used if users want to construct the props before passing it in getPageItemProps.

@nartc nartc reopened this Jun 30, 2019
@davidnguyen11
Copy link
Contributor

Thanks @nartc . Can you squash 2 commits to 1 commit?

Improve getPageItemProps
@davidnguyen11 davidnguyen11 merged commit c02a40b into ChoTotOSS:hook Jul 1, 2019
@nartc nartc deleted the type-defs branch July 1, 2019 13:41
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.

None yet

2 participants