question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New version of React Native + withAuthenticator == funky background

See original GitHub issue

Describe the bug The new version of React Native renders a black background when using the withAuthenticator HOC.

To Reproduce Steps to reproduce the behavior:

  1. Create new React Native project (0.58+).
  2. Install Amplify + Amplify React Native libraries
  3. Add amplify & auth category
  4. Use the withAuthenticator HOC

Expected behavior White background & normal UI shows up

Screenshots screen shot 2019-01-28 at 11 58 17 am

Desktop (please complete the following information):

  • OS: iOS
  • Browser: chrome
  • Version:
{
  "name": "randomrn",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "aws-amplify": "^1.1.19",
    "aws-amplify-react-native": "^2.1.7",
    "react": "16.6.3",
    "react-native": "0.58.2"
  },
  "devDependencies": {
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "24.0.0",
    "jest": "24.0.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

Smartphone (please complete the following information):

  • Device: iPhone X
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22] 10.1

Additional context I tested this with older versions of React Native, as late as 0.57.8, & it worked fine.

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = ‘DEBUG’; in your app.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
manueliglesiascommented, Feb 13, 2019

A workaround for react-native >= 58

const theme = StyleSheet.create({
  ...AmplifyTheme,
  container: {
    ...AmplifyTheme.container,
    backgroundColor: '#FFFFFF'
  }
});
export default withAuthenticator(App, false, [], null, theme);
1reaction
dabit3commented, Feb 1, 2019

If anyone wants a workaround for now, you can initialize a pre 0.58.0 version of React Native until this gets resolved:

react-native init --version 0.57.8 MyProject

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authenticator - React Native - AWS Amplify Docs
A new version of the Amplify Authenticator is available. Visit https://ui.docs.amplify.aws to get started. A simple way to add authentication flows into your ......
Read more >
Building a Startup with React Native and AWS Amplify (part 3)
Let's continue working on the React Native mobile app that I am building for the #notJustStartup Challenge. Today we will start working on ......
Read more >
Headless JS - React Native
Headless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example,...
Read more >
Amplify UI's new Authenticator component makes it easy to ...
AWS Amplify UI recently announced a new version of the ... Update your App.js to use the withAuthenticator Higher-order component (HOC).
Read more >
aws amplify npm
Pre-requisites: Install the latest version of Flutter. ... Start using aws-amplify-react-native in your project by running `npm i aws-amplify-react-native`.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found