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.

Using with react-native-navigation

See original GitHub issue

When i use it with RNN it’s looks like this: image

How i implement:

const ProviderWrap = Comp => props => (
  <View>
    <Comp {...props} />
    <FlashMessage position="top" hideStatusBar={true} />
  </View>
);
Navigation.registerComponent("Login", () => ProviderWrap(Login));

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
MatthewPattellcommented, May 22, 2019

@tyleralves hi, just add:

Navigation.showOverlay({
		component: {
			name:      'app.topBarFlashMessages',
			passProps: {},
			options:   {
				overlay: {
					interceptTouchOutside: false,
				},
				layout:  {
					backgroundColor: 'transparent',
					orientation:     ['portrait'],
				},
			},
		},
	})

and register component:

Navigation.registerComponent('app.topBarFlashMessages', () => TopFlashMessages)

Component:

const styles = StyleSheet.create({
	container: {
		height: 50,
		width:  wp('100%'),
	},
})

const TopFlashMessages= () => {
	return (
		<View style={styles.container}>
			<FlashMessage position="top" />
		</View>
	)
}
5reactions
quiringkcommented, Jan 1, 2020

FYI it wasn’t working for me on the first time you called showMessage because I wasn’t waiting for showOverlay to finish. When the showOverlay promise completes then call showMessage. Like so…

Navigation.showOverlay({
		component: {
			name: "toastMessage",
			passProps: {
				forceUpdate: forceUpdate
			},
			options: {
				overlay: {
					interceptTouchOutside: false
				},
				layout: {
					backgroundColor: "transparent",
					orientation: ["portrait"]
				}
			}
		}
	}).then(() => {
		showMessage({
			message: title,
			description: message,
			type: "info"
		});
	});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Navigating Between Screens - React Native
If you are getting started with navigation, you will probably want to use React Navigation. React Navigation provides a straightforward ...
Read more >
React Native Navigation: Tutorial with examples
React Navigation is a standalone library that enables you to implement navigation functionality in a React Native application. React Navigation ...
Read more >
Hello React Navigation
React Navigation's native stack navigator provides a way for your app to transition between screens and manage navigation history. If your app uses...
Read more >
React Native Navigation Tutorial - Shahed Nasser
In React Navigation, you can subscribe to two events: focus and blur . The focus event will occur every time the screen is...
Read more >
Basic navigation | React Native Navigation
Generally, any mobile app consists of various destinations which display some content to the user. And in vast majority of cases using an...
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