there is an script out there called farsitype.js and i want to use it with react-select component but there is no way to direct access to inner input field to add attribute to it. is there any way that we can add attributes to inner input field in react-select?
If you are talking about this react-select library. You can customize the Inputcomponent like so:
import React from 'react';
import Select, { components } from 'react-select';
import { typeOptions } from '../data';
const Input = props => {
// add attribues to the component below
return <components.Input {...props} />;
};
export default () => (
<Select
components={{ Input }}
options={typeOptions}
/>
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With