I have referenced several similar questions and have not been able to find a solution that works.
import { View, Text, TextInput, Button, StyleSheet, Alert, Picker } from 'react-native';
<Picker
selectedValue={stress}
style={styles.picker}
onValueChange={(itemValue: string) => setStress(itemValue)}
>
{[...Array(10)].map((_, i) => (
<Picker.Item key={i} label={`${i + 1}`} value={`${i + 1}`} />
))}
</Picker>
The error is only at the import. npm run start
works just fine and the UI looks fine. The Picker is working without issue.
I have tried:
- Deleting node_modules
- Re-running npm install
- Opening/Closing the editor
- Adding various flags to npm install (-d to add to dev dependencies, @latest, etc)
- Updating/Installing @types/react and @types/react-native specifically.
Any other suggestions to a solution? I am unsure why this is being so uncooperative.
Thank you