mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: typo in function name + remove unused value state
This commit is contained in:
parent
dd2b661928
commit
3c6120a362
@ -7,13 +7,13 @@ import SearchIcon from '@material-ui/icons/Search';
|
|||||||
|
|
||||||
import { useStyles } from './styles';
|
import { useStyles } from './styles';
|
||||||
|
|
||||||
function SearchField({ value = '', updateValue, className }) {
|
function SearchField({ updateValue, className }) {
|
||||||
const styles = useStyles();
|
const styles = useStyles();
|
||||||
|
|
||||||
const [localValue, setLocalValue] = useState(value);
|
const [localValue, setLocalValue] = useState('');
|
||||||
const debounceUpdateValue = debounce(updateValue, 500);
|
const debounceUpdateValue = debounce(updateValue, 500);
|
||||||
|
|
||||||
const handleCange = e => {
|
const handleChange = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const v = e.target.value || '';
|
const v = e.target.value || '';
|
||||||
setLocalValue(v);
|
setLocalValue(v);
|
||||||
@ -42,7 +42,7 @@ function SearchField({ value = '', updateValue, className }) {
|
|||||||
}}
|
}}
|
||||||
inputProps={{ 'aria-label': 'search' }}
|
inputProps={{ 'aria-label': 'search' }}
|
||||||
value={localValue}
|
value={localValue}
|
||||||
onChange={handleCange}
|
onChange={handleChange}
|
||||||
onBlur={updateNow}
|
onBlur={updateNow}
|
||||||
onKeyPress={handleKeyPress}
|
onKeyPress={handleKeyPress}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user