I have this code that contain props
const Dropdown = (props: Props): React.Node => {
const {
name, isDisable, onChange, placeholder, value, data
} = props;
return (
<Select
onChange={onChange}
defaultValue={valueDefiner(value)}
styles={SelectStyle}
placeholder={placeholder}
name={name}
options={data}
isDisabled={isDisable}
/>
);
};
it's took 3 line for only props
I have assignment to change the props into a function to simplified them, so I can import them as a function and only take 1 line for props