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

Default text and background are the same color on react native 0.58 #5377

Closed
ryanmagoon opened this issue Jan 27, 2019 · 6 comments
Closed

Comments

@ryanmagoon
Copy link

Describe the bug
In react native 58+, the default background color is black instead of white, and so the default UI theming that comes out of the box with storybook UI is invisible

To Reproduce
Steps to reproduce the behavior:
Follow the instructions to install storybook on a newly created react native project
react-native init newProject
cd newProject
npx -p @storybook/cli sb init

Expected behavior
Expected the default text color to not be the same as the background

Screenshots
screen shot 2019-01-26 at 11 26 39 pm

Code snippets
adding this to the style file for the preview list component shows the ui

flex: {
    backgroundColor: 'white',
    flex: 1
  },

screen shot 2019-01-26 at 11 26 46 pm

System:

  • MacOS
  • Device: Macbook pro 2015
  • Framework: react native
  • Version: 4.1.11
@kdenz
Copy link

kdenz commented Feb 6, 2019

For me I realized it's caused by this line in AppDelegate.m for 0.58.x
It becomes
rootView.backgroundColor = [UIColor blackColor];
whereas previously it's
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

Now I changed it to
rootView.backgroundColor = [UIColor whiteColor];
and it defaults to white again

@stale
Copy link

stale bot commented Feb 27, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Feb 27, 2019
@stale stale bot removed the inactive label Feb 27, 2019
@stale
Copy link

stale bot commented Mar 20, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Mar 20, 2019
@fo-fo
Copy link

fo-fo commented Mar 24, 2019

Non-intrusive workaround is to wrap the StorybookUIRoot component inside a View with its background color set to white:

const WrappedStorybook = () => (
  <View style={{ flex: 1, backgroundColor: "white" }}>
    <StorybookUIRoot />
  </View>
);

@stale stale bot removed the inactive label Mar 24, 2019
@kaiwen-zhang-ck
Copy link

what a hack. is there official issue to change this? why is default black?

@shilman
Copy link
Member

shilman commented Apr 3, 2019

@shilman shilman closed this as completed Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants