March 2019
Intermediate to advanced
534 pages
14h 52m
English
Here's the source for the Control component:
const inputComponent = ({ inputRef, ...props }) => ( <div ref={inputRef} {...props} />);const Control = props => ( <TextField fullWidth InputProps={{ inputComponent, inputProps: { className: props.selectProps.classes.input, inputRef: props.innerRef, children: props.children, ...props.innerProps } }} {...props.selectProps.textFieldProps} />);
The inputComponent() function is a component that passes the inputRef value—a reference to the underlying input element—to the ref prop. Then, inputComponent is passed to InputProps to set the input component used by TextField. This component is a little bit confusing because it's passing references around and it uses a helper component for ...
Read now
Unlock full access