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

docs: correct preview.js example in README #413

Merged
merged 3 commits into from
Dec 16, 2022

Conversation

JeffGuKang
Copy link
Contributor

@JeffGuKang JeffGuKang commented Dec 16, 2022

Issue:

preview.js makes error in README.
addon-ondevice-backgrounds needs values option.

Error

 ERROR  TypeError: undefined is not a function

This error is located at:
    in BackgroundPanel (created by Wrapper)
    in RCTScrollContentView (created by ScrollView)
    in RCTScrollView (created by ScrollView)
    in ScrollView (created by ScrollView)
    in ScrollView (created by Wrapper)
...

image

It looks values is missed in README.

node_modules/@storybook/addon-ondevice-backgrounds/dist/BackgroundPanel.js

53~57

    return (react_1.default.createElement(react_native_1.View, null, backgrounds ? (backgrounds.values.map(function (_a) {
        var value = _a.value, name = _a.name;
        return (react_1.default.createElement(react_native_1.View, { key: "".concat(name, " ").concat(value) },
            react_1.default.createElement(Swatch_1.default, { value: value, name: name, setBackground: setBackgroundFromSwatch })));
    })) : (react_1.default.createElement(Instructions, null))));

What I did

Correct README

How to test

Please explain how to test your changes and consider the following questions

  • Does this need a new example in examples/native?
    No. Example has right option.
  • Does this need an update to the documentation?
    I did.

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

@JeffGuKang JeffGuKang changed the title docs: correct addob-backgrounds option in README docs: correct addon-backgrounds option in README Dec 16, 2022
@JeffGuKang JeffGuKang changed the title docs: correct addon-backgrounds option in README docs: correct preview example in README Dec 16, 2022
@JeffGuKang JeffGuKang changed the title docs: correct preview example in README docs: correct preview.js example in README Dec 16, 2022
@dannyhw
Copy link
Member

dannyhw commented Dec 16, 2022

nice catch!

README.md Show resolved Hide resolved
@dannyhw
Copy link
Member

dannyhw commented Dec 16, 2022

thanks for your contribution 🙇

@dannyhw dannyhw merged commit 6e379d3 into storybookjs:next-6.0 Dec 16, 2022
@JeffGuKang JeffGuKang deleted the patch-1 branch December 16, 2022 14:31
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