Adds note about forwarding ref on custom inputs#631
Adds note about forwarding ref on custom inputs#631ashfurrow wants to merge 1 commit intomoroshko:masterfrom
Conversation
|
@ashfurrow when I try your example I get: Does your example really work? What versions of I currently get the following warning when implementing a simple |
|
@ashfurrow thanks for the pointers! I also figured out from the commits that you referenced how to make it work. However I believe that the example you added to the documentation won't work as is since it leads to the error message I mentioned above ( To make it work I had to do something like this: const CustomInput = React.forwardRef((props, ref) => (
<div>
<input {...props} ref={ref} />
<div>custom stuff</div>
</div>
));
const renderInputComponent = props => <CustomInput {...props} />;An alternative would be to make |
|
Oh, I see the confusion – I named the component @ctavan do you want to suggest some inline changes to this PR? That way you'd get credit in the commits for this clarification 👍 |

Hello! Thanks for your library. We had to add a forward ref to get
react-autosuggestto work with a custom input component. This PR adds this requirement to the docs in the readme. Thanks again!