refactoring due to facebook/react/pull/15047

This commit is contained in:
or-else
2019-08-15 10:30:29 +03:00
parent f1744c3f69
commit 0217d84721
23 changed files with 192 additions and 161 deletions
-16
View File
@@ -39,23 +39,7 @@ export default class ChipInput extends React.Component {
this.setState({input: ''});
}
}
/*
static getDerivedStateFromProps(nextProps, prevState) {
const state = {
placeholder: nextProps.chips ? '' : nextProps.prompt,
sortedChips: ChipInput.sortChips(nextProps.chips, nextProps.required),
chipIndex: ChipInput.indexChips(nextProps.chips),
focused: prevState && prevState.focused
};
if (!prevState || nextProps.chips.length > prevState.sortedChips.length) {
// Chip added: clear input.
state.input = '';
}
return state;
}
*/
// Map chip index to user name
static indexChips(chips) {
const index = {};