We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I attempt to reset the values back to 0 after submitting, the component doesn't rerender
const [ozValue, setOzValue] = useState(0); const [minuteValue, setMinuteValue] = useState(0); const clearValues = () => { setOzValue(0); setMinuteValue(0); }; const onSubmitNext = () => { setOzValue(0); setMinuteValue(0); }; return ( <KeyboardAwareScrollView contentContainerStyle={styles.modalContainer}> <Text style={styles.modalHeader}>{title}</Text> <View style={styles.numInputContainer}> <Text style={styles.subHeader}>Enter oz amount</Text> <NumericInput value={ozValue} onChange={(ozValue) => setOzValue(ozValue)} minValue={0} totalWidth={150} totalHeight={35} iconSize={35} step={0.5} valueType="real" rounded textColor="black" rightButtonBackgroundColor={Colors[colorScheme].tabIconSelected} leftButtonBackgroundColor={"#a57ee0"} iconStyle={{ color: "white", fontSize: 20, fontWeight: "bold", }} /> </View> <View style={styles.numInputContainer}> <Text style={styles.subHeader}>Enter duration</Text> <NumericInput value={minuteValue} minValue={0} onChange={(minuteValue) => setMinuteValue(minuteValue)} totalWidth={150} totalHeight={35} iconSize={35} step={1} valueType="real" rounded textColor="black" rightButtonBackgroundColor={Colors[colorScheme].tabIconSelected} leftButtonBackgroundColor={"#a57ee0"} iconStyle={{ color: "white", fontSize: 20, fontWeight: "bold", }} /> </View> <View style={styles.buttonContainer}> <Button color={Colors[colorScheme].tabIconSelected} mode="contained" onPress={onSubmit} disabled={disabled()} > Add </Button> <Button color={Colors[colorScheme].tabIconSelected} mode="contained" disabled={disabled()} onPress={onSubmitNext} > Add&Next </Button> <Button mode="contained" color={"#a57ee0"} onPress={modalClose}> Cancel </Button> </View> </KeyboardAwareScrollView> ); }
Expected behavior I expect the values to reset back to 0 on state change.
Screenshots or Screen recording
The text was updated successfully, but these errors were encountered:
I also went through the same thing, the component doesn't render to the parent like a does.
I recommend another similar package, updated with on hooks
Sorry, something went wrong.
No branches or pull requests
When I attempt to reset the values back to 0 after submitting, the component doesn't rerender
Expected behavior
I expect the values to reset back to 0 on state change.
Screenshots or Screen recording
The text was updated successfully, but these errors were encountered: