Skip to content

Commit

Permalink
Fixed settings the data on use effect
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomurrent-softwaresolutions committed Mar 11, 2021
1 parent 22fcaed commit 4f83ca4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/RNSingleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ const RNSingleSelect = (props: IProps) => {
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 4f83ca4

Please sign in to comment.