Archives : September-2020

I am trying to use firebase database for my project but I am unable to properly import and use the module. I have followed what the official documentation recommends. This is the code where I am using it. import React from "react"; import firebase from "firebase"; import ProjectItemCards from "./components/project-item-cards"; const ProjectContext = React.createContext(); class ..

Read more

I have done something very simular to the Sidebar example from react Router https://reactrouter.com/web/example/sidebar Can I pass props to the sidebar somehow? import React from "react"; import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom"; // Each logical "route" has two components, one for // the sidebar and one for the main area. ..

Read more

Let’s say I have 2 very simple Routers. Each of them is a separate component. First one is the ParentRouter: <TopComponent></TopComponent> <Router> <Switch> <Route path="/child" component={ChildRouter}> </Route> <Route path="/outside" component={OutsideComponent}> </Route> </Switch> </Router> Second one is the ChildRouter: <Router> <Switch> <Route exact path="/child" component={ListOfExampleComponents}> </Route> <Route path="/child/example" component={ExampleComponent}> </Route> </Switch> </Router> TopComponent is displayed all ..

Read more

const HomeScreen =({navigation})=>{ return( <View style={styles.mainContainer}> <View style={styles.iconContainer}> <TouchableOpacity onPress={()=> {}}> <View style={styles.iconText}> <Icon name="home" size={30} color=’#FF6733’/> <Text>Home</Text> </View> </TouchableOpacity> <TouchableOpacity onPress={()=> navigation.navigate(‘Shop’)}> <View style={styles.iconText}> <Icon name="shopping-cart" size={30} color=’#FF6733’/> <Text >Shop</Text> </View></TouchableOpacity> <TouchableOpacity onPress={()=>navigation.navigate(‘Bag’)}> <View style={styles.iconText}> <Icon name="shopping-bag" size={30} color=’#FF6733’/> <Text >Bag</Text> </View> </TouchableOpacity> <TouchableOpacity onPress={()=> navigation.navigate(‘faviroute’)}> <View style={styles.iconText}> <Icon name="heart" size={30} color=’#FF6733’/> <Text >Favorites</Text> ..

Read more