Last active
August 5, 2018 01:45
-
-
Save revanth0212/b00d88b34c63a05dfc7f4955d51abb24 to your computer and use it in GitHub Desktop.
This is a sample rules object that shows the interaction between country and phone number fields in a state object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rules = { | |
country: [ | |
{ | |
name: 'phoneNumber', | |
path: ['fields', 'phoneNumber'], | |
props: (countryNewValue, state) => ({ | |
editable: countryNewValue && countryNewValue !== '', | |
countryPhoneCode: countryPhoneCodeMapper[countryNewValue] | |
}) | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment