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 addon-knobs ObjectType knob react warning #5276 #6159

Merged
merged 3 commits into from Mar 23, 2019
Merged

Fix addon-knobs ObjectType knob react warning #5276 #6159

merged 3 commits into from Mar 23, 2019

Conversation

leoyli
Copy link
Contributor

@leoyli leoyli commented Mar 18, 2019

Issue: #5276

What I did

  • Fixed the getDerivedStateFromProps console warning due to no initial state provided to React.

How to test

  • Is this testable with Jest or Chromatic screenshots?
    No

  • Does this need a new example in the kitchen sink apps?
    No

  • Does this need an update to the documentation?
    No

If your answer is yes to any of these, please make sure to include it in your PR.

@shilman shilman added bug addon: knobs patch:yes Bugfix & documentation PR that need to be picked to main branch labels Mar 19, 2019
@shilman shilman added this to the 5.0.x milestone Mar 19, 2019
@shilman
Copy link
Member

shilman commented Mar 19, 2019

@leoyli getting some linting errors:

/tmp/storybook/addons/knobs/src/components/types/Object.js
  12:7  error  Unused state field: 'values'  react/no-unused-state
  14:7  error  Unused state field: 'state'   react/no-unused-state

@codecov
Copy link

codecov bot commented Mar 19, 2019

Codecov Report

Merging #6159 into next will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #6159      +/-   ##
==========================================
- Coverage   38.04%   38.03%   -0.01%     
==========================================
  Files         643      643              
  Lines        9420     9422       +2     
  Branches     1373     1344      -29     
==========================================
  Hits         3584     3584              
- Misses       5268     5270       +2     
  Partials      568      568
Impacted Files Coverage Δ
addons/knobs/src/components/types/Object.js 17.39% <0%> (-1.66%) ⬇️

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 7c7ecbb...c574c1d. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 19, 2019

Codecov Report

Merging #6159 into next will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #6159      +/-   ##
==========================================
- Coverage   38.04%   38.03%   -0.01%     
==========================================
  Files         643      643              
  Lines        9420     9422       +2     
  Branches     1373     1373              
==========================================
  Hits         3584     3584              
- Misses       5268     5270       +2     
  Partials      568      568
Impacted Files Coverage Δ
addons/knobs/src/components/types/Object.js 17.39% <0%> (-1.66%) ⬇️

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 7c7ecbb...e34bbfc. Read the comment docs.

@leoyli
Copy link
Contributor Author

leoyli commented Mar 19, 2019

@shilman, thanks for the heads up! For some reason I've made a typo here... I've made a correction. :)

@leoyli
Copy link
Contributor Author

leoyli commented Mar 21, 2019

@shilman, I still see 1 checks is neutral/pending... Is this a blocker?! If so what should I do?!

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Hi @leoyli This fixes the warning but looks like it causes a bug. When I run official-storybook on this branch I don't see the Styles options as I expect in the knobs UI. Here's what it should look like on next:

Storybook

Mind digging in and see if you can figure out what's wrong?

@leoyli
Copy link
Contributor Author

leoyli commented Mar 22, 2019

@shilman, Oh yes, I'm happy to make contributions to make this thing great. I will find a time during weekend to work on this. Thank you for your review and catching my bug!

@Hypnosphi Hypnosphi removed their request for review March 22, 2019 09:15
@leoyli
Copy link
Contributor Author

leoyli commented Mar 23, 2019

@shilman, I can see the problem you've mentioned. I have just committed a change to fix this, which is simpler and safer I believe. :) I have test in my local machine and ensure the knob running as expected and no printing ObjectType errors.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM and working great. Thanks for fixing this @leoyli !

@shilman shilman merged commit d716b72 into storybookjs:next Mar 23, 2019
@leoyli
Copy link
Contributor Author

leoyli commented Mar 23, 2019

Thank you for your review, I will try to find what else I can contribute!

@shilman shilman added patch:done Patch/release PRs already cherry-picked to main/release branch and removed patch:done Patch/release PRs already cherry-picked to main/release branch labels Mar 23, 2019
shilman added a commit that referenced this pull request Mar 23, 2019
Fix addon-knobs ObjectType knob react warning #5276
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: knobs bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants