Open ashsharma1 opened 3 years ago
import address1sList from './data/address1s_list.json';
export default AddContact = ({navigation}) => { const [address1, setAddress1] = useState();
const changeAddress1 = () => { setAddress1(null); }; render ( ... <Dropdown label="village" required data={address1sList} enableSearch value={address1} onChange={setAddress1} emptyListText="Select District First" /> ... );
If I were to change address1 via a function, it does not re-render the Dropdown component in the render. How can I make this reactive?
You mean resetting the state? You should try this @ashsharma1 https://github.com/ravimaurya-nickelfox/sharingan-rn-modal-dropdown
import address1sList from './data/address1s_list.json';
export default AddContact = ({navigation}) => { const [address1, setAddress1] = useState();
const changeAddress1 = () => { setAddress1(null); }; render ( ... <Dropdown label="village" required data={address1sList} enableSearch value={address1} onChange={setAddress1} emptyListText="Select District First" /> ... );
If I were to change address1 via a function, it does not re-render the Dropdown component in the render. How can I make this reactive?