react-navigation

How can I curve the top two corners of react-navigation-material-bottom-tabs?

半城伤御伤魂 提交于 2021-01-20 08:07:27
问题 I am new to react native and I am using react-navigation & react-navigation-material-bottom-tabs . All I want to do is curve the top-right corner and top-left corner of bottom tab bar. My Code: const screen1 = createMaterialBottomTabNavigator( { Home: { screen: HomeScreen, style : { backgroundColor: 'black' } }, About: AboutScreen, Scan: ScanScreen, Fav: AllScreen }, { initialRouteName: "Home", activeColor: 'red', inactiveColor: 'blue', barStyle: { borderWidth: 0.5, borderBottomWidth: 1,

How do I go back in webview? I am using the react-navigation package in react-native

a 夏天 提交于 2021-01-18 10:13:52
问题 I installed the react-navigation package in react-native I have implemented tab navigation and one of them is implemented in webview format. My problem is that if I press the back physical button on Android, I go from the app itself to the previous tab, not back from the webview. I've already applied the back button for the webview on the internet, but I have not done that. I tried to display the onNavigationStateChange log when debugging, but it was not updated when url was moved after it

How do I go back in webview? I am using the react-navigation package in react-native

寵の児 提交于 2021-01-18 10:10:05
问题 I installed the react-navigation package in react-native I have implemented tab navigation and one of them is implemented in webview format. My problem is that if I press the back physical button on Android, I go from the app itself to the previous tab, not back from the webview. I've already applied the back button for the webview on the internet, but I have not done that. I tried to display the onNavigationStateChange log when debugging, but it was not updated when url was moved after it

Change app background color in React Native

╄→尐↘猪︶ㄣ 提交于 2021-01-17 17:51:36
问题 I'm trying to change the color of the background in my react native app, from grey to white. I'm using react-navigation to make a TabNavigator after I render it. I tried to put this TabNavigator in a view and set backgroundColor but all screen became white. How can I solve this? index.js ... render() { return ( <View style={{ backgroundColor: '#FFFFFF'}}> <Tabs /> </View> ) } ... Tabs ... const Tabs = TabNavigator( { Home: { screen: HomeStack, navigationOptions: { title: 'Acasa', }, }, ...

Change app background color in React Native

一世执手 提交于 2021-01-17 17:50:32
问题 I'm trying to change the color of the background in my react native app, from grey to white. I'm using react-navigation to make a TabNavigator after I render it. I tried to put this TabNavigator in a view and set backgroundColor but all screen became white. How can I solve this? index.js ... render() { return ( <View style={{ backgroundColor: '#FFFFFF'}}> <Tabs /> </View> ) } ... Tabs ... const Tabs = TabNavigator( { Home: { screen: HomeStack, navigationOptions: { title: 'Acasa', }, }, ...

Change app background color in React Native

喜你入骨 提交于 2021-01-17 17:49:26
问题 I'm trying to change the color of the background in my react native app, from grey to white. I'm using react-navigation to make a TabNavigator after I render it. I tried to put this TabNavigator in a view and set backgroundColor but all screen became white. How can I solve this? index.js ... render() { return ( <View style={{ backgroundColor: '#FFFFFF'}}> <Tabs /> </View> ) } ... Tabs ... const Tabs = TabNavigator( { Home: { screen: HomeStack, navigationOptions: { title: 'Acasa', }, }, ...

React - Preference: function class vs component class

假如想象 提交于 2021-01-15 18:47:45
问题 Are class components being abandoned? I see that in several libraries examples have function components as a priority. Especially React Navigation. Likewise, React itself with Hooks only makes them available for function components. The main question is: Why are function components being so prioritized? 回答1: No, i think Class Components won't be abandoned today. Maybe in future. They aren't lightweight as Functional Components can be, but i see a lot projects on community using Class

Pass props nicely to screens in react navigation

本小妞迷上赌 提交于 2021-01-07 02:48:32
问题 I want to pass a prop to the screen. When I try that inline e.g (props) => <Comp {...props} {...customProps} /> I get a warning message, that I shouldn't parse functions to that component property. Okay. I thought I'll just create functions for every component which needs custom props. It is working, but is there a better solution? Here is my component: export default function Loading() { const [loggedIn, setLoggedIn] = React.useState(false); const Stack = createStackNavigator(); const

Pass props nicely to screens in react navigation

白昼怎懂夜的黑 提交于 2021-01-07 02:44:57
问题 I want to pass a prop to the screen. When I try that inline e.g (props) => <Comp {...props} {...customProps} /> I get a warning message, that I shouldn't parse functions to that component property. Okay. I thought I'll just create functions for every component which needs custom props. It is working, but is there a better solution? Here is my component: export default function Loading() { const [loggedIn, setLoggedIn] = React.useState(false); const Stack = createStackNavigator(); const

Pass props nicely to screens in react navigation

我怕爱的太早我们不能终老 提交于 2021-01-07 02:44:02
问题 I want to pass a prop to the screen. When I try that inline e.g (props) => <Comp {...props} {...customProps} /> I get a warning message, that I shouldn't parse functions to that component property. Okay. I thought I'll just create functions for every component which needs custom props. It is working, but is there a better solution? Here is my component: export default function Loading() { const [loggedIn, setLoggedIn] = React.useState(false); const Stack = createStackNavigator(); const