React Native: Backgrounds addon
See original GitHub issueDescribe the bug
The backgrounds addon for ondevice doesnβt work as expected. Iβve seen several issues:
- When combined with the knobs addon and importing the backgrounds addon first, an error is thrown:
TypeError: null is not an object (βevaluating this.state.selectionβ).
I see duplicate dependencies (nested node_modules) so perhaps something hasnβt been updated yet? For some reason this.state
is null in the BackgroundPanel.render()
.
- Once loaded, the background colour I set as a default is shown, but thereβs no panel for me to change the background colour and thus I can only ever see one of the colours. I do think the two issues are related.
To Reproduce
This is a new React Native project with all the latest versions of storybook (@next
). Itβs all basic quick start stuff (addons file, and decorators).
Expected behavior
A way to toggle the background colour.
System:
- Device: iPhone X
- Framework: React Native
- Addons: Knobs and backgrounds
- Version: See additional
Additional context
A dump of all storybook related packages and their versions:
mixed/efteling-app [ yarn list | grep storybook feature/APP-2743-storybook * ] 10:49 AM
ββ @storybook/addon-actions@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
β ββ @storybook/api@5.2.0-beta.0
β ββ @storybook/client-api@5.2.0-beta.0
β ββ @storybook/components@5.2.0-beta.0
β ββ @storybook/core-events@5.2.0-beta.0
β ββ @storybook/theming@5.2.0-beta.0
ββ @storybook/addon-backgrounds@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
β ββ @storybook/api@5.2.0-beta.0
β ββ @storybook/client-logger@5.2.0-beta.0
β ββ @storybook/components@5.2.0-beta.0
β ββ @storybook/core-events@5.2.0-beta.0
β ββ @storybook/theming@5.2.0-beta.0
ββ @storybook/addon-knobs@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
β ββ @storybook/client-api@5.2.0-beta.0
β ββ @storybook/components@5.2.0-beta.0
β ββ @storybook/core-events@5.2.0-beta.0
β ββ @storybook/theming@5.2.0-beta.0
ββ @storybook/addon-ondevice-actions@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
β ββ @storybook/core-events@5.2.0-beta.0
ββ @storybook/addon-ondevice-backgrounds@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
ββ @storybook/addon-ondevice-knobs@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
β ββ @storybook/core-events@5.2.0-beta.0
ββ @storybook/addon-storyshots@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
ββ @storybook/addons@5.2.0-beta.0
β ββ @storybook/api@5.2.0-beta.0
β ββ @storybook/channels@5.2.0-beta.0
β ββ @storybook/client-logger@5.2.0-beta.0
ββ @storybook/api@5.2.0-beta.0
β ββ @storybook/channels@5.2.0-beta.0
β ββ @storybook/client-logger@5.2.0-beta.0
β ββ @storybook/core-events@5.2.0-beta.0
β ββ @storybook/router@5.2.0-beta.0
β ββ @storybook/theming@5.2.0-beta.0
ββ @storybook/channel-postmessage@5.2.0-beta.0
β ββ @storybook/channels@5.2.0-beta.0
β ββ @storybook/client-logger@5.2.0-beta.0
ββ @storybook/channel-websocket@5.2.0-beta.0
β ββ @storybook/channels@5.2.0-beta.0
ββ @storybook/channels@5.2.0-beta.0
ββ @storybook/client-api@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
β ββ @storybook/channel-postmessage@5.2.0-beta.0
β ββ @storybook/channels@5.2.0-beta.0
β ββ @storybook/client-logger@5.2.0-beta.0
β ββ @storybook/core-events@5.2.0-beta.0
β ββ @storybook/router@5.2.0-beta.0
ββ @storybook/client-logger@5.2.0-beta.0
ββ @storybook/components@5.2.0-beta.0
β ββ @storybook/client-logger@5.2.0-beta.0
β ββ @storybook/theming@5.2.0-beta.0
ββ @storybook/core-events@5.2.0-beta.0
ββ @storybook/react-native@5.2.0-beta.0
β ββ @storybook/addons@5.2.0-beta.0
β ββ @storybook/channel-websocket@5.2.0-beta.0
β ββ @storybook/channels@5.2.0-beta.0
β ββ @storybook/client-api@5.2.0-beta.0
β ββ @storybook/core-events@5.2.0-beta.0
ββ @storybook/router@5.2.0-beta.0
ββ @storybook/theming@5.2.0-beta.0
β ββ @storybook/client-logger@5.2.0-beta.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
@storybook/addon-ondevice-backgrounds - npm
A react-native storybook addon to show different backgrounds for your preview. Latest version: 5.3.23, last published: 2 years ago.
Read more >storybook/addon-ondevice-backgrounds
A react-native storybook addon to show different backgrounds for your preview. ... With Storybook for React Native you can design and develop individualΒ ......
Read more >Two Easy Ways to Add React Native Background Image
The ultimate guide to adding a react native background image to your application with two straightforward different approaches.
Read more >@storybook/addon-backgrounds | Yarn - Package Manager
Storybook Addon Backgrounds can be used to change background colors inside the preview in Storybook. Framework Support. React Storybook ScreenshotΒ ...
Read more >Channel Background Customization - React Native SDK Docs
Basic Custom Background#. You can change the background statically by wrapping MessageList and MessageInput with the ImageBackground component. Also make sureΒ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Both issues have been fixed through #7437
@RWOverdijk More the former than the later, I assure you π