И

Size: a a a
И

kS
VS
k🥔
S
VS
VK
ES
IN
k🥔
k🥔
VS
k🥔
VK
S
k🥔
DP
onChangeSearchInput = (text) => {
const { tableData } = this.state
this.setState({
search: {
...this.state.search,
text,
},
})
const regExp = new RegExp(text, 'ig')
const filterName = tableData
.filter((quiz) => regExp.test(quiz.name))
.map((quiz) => {
return quiz.name
})
console.log(filterName)
if (filterName.length) {
this.setState({
search: {
...this.state.search,
listPrompts: [...filterName],
},
})
}
}DP
IS
useImperativeHandle не работает как я хочу.const Input = ({ inputProps: { component, ...rest } }) => (
<StripeInput component={WrappedInput} {...rest} />
);port React, { useRef, useImperativeHandle } from 'react';
const StripeInput = ({ component: Component, inputRef, ...props }) => {
const elementRef = useRef();
useImperativeHandle(inputRef, () => ({
focus: () => elementRef.current.focus
}));
return (
<Component
onChange={element => (elementRef.current = element)}
{...props}
/>
);
};
export default StripeInput;
пытаюсь использовать так:utработает. есть идеи?
id='card'
type='text'
value={values.card || ''}
onChange={onChange}
placeholder='Card number'
className={errors.card ? styles.error : ''}
inputProps={{
component: StripeInput,
inputProps: {
component: CardNumberElement
}
}}
не
IS
const WrappedInput = props => <input {...props} />;