React Native
React Native
async storage
AsyncStorage.setItem("user", JSON.stringify(jsObject));
await AsyncStorage.clear();
2. formdata
const fetchFunction = async () => {
formdata.append("name", "didul");
formdata.append("age", 19);
try {
method: "POST",
body: formdata,
headers: {
'Content-Type': 'multipart/form-data'
}
});
if (response.ok) {
} else {
console, log("Error")
} catch (error) {
console.log(error)
} }
fetchFunction();
}
3. use state
export default function home2() {
4. use effect
useEffect(() => {
}, []);
5. pressable
<Pressable onPress={()=>{
}}>
<Text>Go to Index</Text>
</Pressable>
6. stylesheet
export default function h1() {
return (
<view>
<view/>
);
text1:{
fontSize: 30,
color:'white',
alignSelf:'center'
},
});
data={DATA}
<Text>{item.title}</Text>
)}
estimatedItemSize={50}
/>
8. splashscreen
SplashScreen.preventAutoHideAsync();
SplashScreen.hideAsync();
9.start
npx create-expo-app@latest
StickerSmash --template blank
npm i
10.object
et userObj = {
"name": "mohan",
"age": "89"
}
userObj.name
11.array
let userarray = [
{
"name": "mohan",
"age": "89"
},
{
"name": "Bamidu",
"age": "18"
}
]
console.log(userarray [0])