You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReactfrom'react';import{Text}from'react-native';import{makeStyles}from'react-native-elements';// 1. All other examples are JS but this example as TS?typeParams={fullWidth?: boolean,};constMyComponent=(props: Props)=>{conststyles=useStyles(props);return({/* 2. 'View' & 'theme' are not defined. */}<Viewstyle={styles.container}><Textstyle={{color: theme.colors.primary}}>Yo!</Text></View>);};constuseStyles=makeStyles((theme,props: Props)=>({container: {background: theme.colors.white,width: props.fullWidth ? '100%' : 'auto',},text: {color: theme.colors.primary,},}));
Possible Solution
Check Snack for the corrected as well as the original code.
Screenshot
The text was updated successfully, but these errors were encountered:
Explain what you did
I was reading documentation and came across a possibly erroneous code snippet.
Steps
makeStyles()
exampleCode Snippet
I have written possible errors as comments.
Possible Solution
Check Snack for the corrected as well as the original code.
Screenshot
The text was updated successfully, but these errors were encountered: