react native2

  const [state,setstate]=useState(0);

  const clickHandler=()=>{

    alert("good mroning");

    setstate(state+1);

  }


{/* <Button style={styles.button}

  onPress={()=>{Linking.openURL(`https://bazartaxi.com/`)}}

  title='update'/> */}

  <Button style={styles.button} title='Increment' onPress={clickHandler}

  color="red"/>

 <Button

          title="Right button"

          onPress={() => Alert.alert('Right button pressed')}


inline css:

 <Text style={{color:'green'}}>Gaurav pandey</Text>


ctrl+space :property


core component ap: basic component:select that component :style [prop]

flex:...

flex-Direction:'row'//...

alignItems:'stretch'[horizontal]

justifyContent:'flex-start'[vertical]





const [state,setState]=useState([

      {'name':'radhe','address':'world'},

      {'name':'amit','address':'gurugram'},

      {'name':'raj','address':'noida'},

      {'name':'rakesh','address':'rajasthan'},

  ])




 <View>

        <Text>

{

    state.map(item=>{

        return(

            <View style={styles.item}>

                <Text>{item.name} {item.address}</Text>

                </View>

        )

    })

}

        </Text>

    </View>


Comments

Popular posts from this blog

interview questions js[ Anurag Singh ProCodrr]

reactnative_creation