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.

How to use with wix react-native-navigation?

See original GitHub issue

wix’s react-native-navigation doesn’t seem to implement rendering via components but instead using native controllers. For example, we might start our navigation using:

import { Navigation } from 'react-native-navigation';

import { registerScreens } from './screens';

registerScreens(); // this is where you register all of your app's screens

// start the app
Navigation.startTabBasedApp({
  tabs: [
    {
      label: 'One',
      screen: 'example.FirstTabScreen', // this is a registered name for a screen
      icon: require('../img/one.png'),
      selectedIcon: require('../img/one_selected.png'), // iOS only
      title: 'Screen One'
    },
    {
      label: 'Two',
      screen: 'example.SecondTabScreen',
      icon: require('../img/two.png'),
      selectedIcon: require('../img/two_selected.png'), // iOS only
      title: 'Screen Two'
    }
  ]
});

This doesn’t implement a component that I can inject inside <StyleProvider style={getTheme(material)}> … </StyleProvider> … So I can’t figure out theming.

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
awchang56commented, Jan 5, 2018

@jrryhrtn could you please share how you made your HOC with toast? I am having the same issue

7reactions
aemdycommented, Jul 25, 2017

I’m experiencing a similar issue, but with <Root> component. Style Provider works fine.

function wrap(WrappedComponent) {
  return class extends React.Component {
    constructor(props) {
      super(props);
      NavigationActions.setNavigator(props.navigator);
    }

    static navigatorButtons = WrappedComponent.navigatorButtons;
    static navigatorStyle = WrappedComponent.navigatorStyle;

    render() {
      return (
        <StyleProvider style={getTheme(platform)}>
          <Root>
            <WrappedComponent {...this.props}/>
          </Root>
        </StyleProvider>
      );
    }
  };
}

And then I wrap every screen I register with this function: Navigation.registerComponent('some.identifier', () => wrap(LoginScreen), store, Provider);

Styles work fine, but I’m experiencing an error with toast (the one like here https://github.com/GeekyAnts/NativeBase/issues/1016#issuecomment-313403253)

Is there any other way I could wrap my components with root?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Before you start | React Native Navigation
React Native Navigation is a module, dependent on and intended to be used alongside React Native, so some experience with it and knowledge...
Read more >
wix/react-native-navigation - GitHub
React Native Navigation provides 100% native platform navigation on both iOS and Android for React Native apps. The JavaScript API is simple and...
Read more >
React Native Navigation (V2) by Wix — Getting Started - Medium
A first look at building React Native apps with React Native Navigation. To view the final code for this project, click here. Wix...
Read more >
An introduction to react-native-navigation | by Yassir Hartani
One of the most challenging things in react-native is choosing the right navigation, and that's because Facebook use a native navigation system (a...
Read more >
Structuring React Native app navigation - datarockets
Most of them are made in pure JS, which is not bad, but if your desire is to have truly native navigation you've...
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