Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const [isRipetitive, setIsRipetitive] = useState(false);
- const [daysOfWeek, setDaysOfWeek] = useState({
- 'lunedì': false,
- 'martedì': false,
- 'mercoledì': false,
- 'giovedì': false,
- 'venerdì': false,
- 'sabato': false,
- 'domenica': false
- });
- const pickDaysOfWeek = (day) => {
- setDaysOfWeek({ ...daysOfWeek, [day]: !daysOfWeek[day] });
- }
- {
- isRipetitive &&
- <View>
- {Object.entries(daysOfWeek).map(
- ([day, status]) => (
- <CheckBox
- key={day}
- value={status}
- onClick={pickDaysOfWeek(day)}
- />)
- )}
- </View>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement