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

fix(customPropTypes|typings): allow to pass a function to itemShorthand, update typings #3183

Merged
merged 2 commits into from
Sep 30, 2018

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Sep 30, 2018

POSSIBLE BREAKING CHANGE

src/index.d.ts was renamed to src/generic.d.ts I hope that noone used it from dist/commonjs/index.d.ts because all types are reexported from the root. However I think that this thing should be noticed.

Fixes and improvements

  1. In feat(factories): support functions #2790 we introduced a small update to shorthands, however customPropTypes.itemShorthand wasn't updated. This PR does this. Fixes Pagination: Functions work for pageItem, etc. props, but warning is raised for invalid prop #3181.

  2. Typings were improved, you will get working autocomplete there 👍 It also satisfies noImplicitAny ✌️

  <Button
    content="Foo"
    icon={(Component, props) => (
      <div className="bar">
        <Component name={props.name} />
      </div>
    )}
  />

peek 2018-09-30 13-26

  1. Some typings tests were added.

@codecov-io
Copy link

Codecov Report

Merging #3183 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3183   +/-   ##
=======================================
  Coverage   99.92%   99.92%           
=======================================
  Files         163      163           
  Lines        2746     2746           
=======================================
  Hits         2744     2744           
  Misses          2        2

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b97de42...f022fe2. Read the comment docs.

@layershifter layershifter merged commit 4bcdbea into master Sep 30, 2018
@layershifter layershifter deleted the fix/customproptypes-item branch September 30, 2018 10:33
@levithomason
Copy link
Member

Released in [email protected].

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.

3 participants