Skip to content

Commit

Permalink
Merge pull request #10 from meecodebymariomurrent/feature/initial-val…
Browse files Browse the repository at this point in the history
…ue-update

Fixed settings the data on use effect
  • Loading branch information
WrathChaos authored Mar 11, 2021
2 parents ae61586 + 8f9462f commit 01b1a56
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/RNSingleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,13 @@ const RNSingleSelect = (props: IProps) => {
React.useEffect(() => {
if (darkMode) setTheme(DARK);
else setTheme(LIGHT);

setSelectedItem(initialValue);
setPlaceholderText(placeholder);
}, []);

React.useEffect(() => {
setDataSource(data);
setDataBackup(data);
setSelectedItem(initialValue);
setPlaceholderText(placeholder);
}, [data]);

const animateBorderRadius = () => {
Expand Down

0 comments on commit 01b1a56

Please sign in to comment.