From 1a00295bfb2793ff8be3087dd7b5498bd3397a93 Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Fri, 19 Apr 2019 11:52:25 -0400 Subject: [PATCH] Adds note about forwarding ref on custom inputs. --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index da582464..d989ca35 100644 --- a/README.md +++ b/README.md @@ -486,15 +486,17 @@ To keep Autosuggest [accessible](https://rawgit.com/w3c/aria-practices/master/ar * render an input * pass through all the provided `inputProps` to the input +Additionally, the rendered component requires a [forwarded ref](https://reactjs.org/docs/forwarding-refs.html) to the actual `input` component. + Example: ```js -const renderInputComponent = inputProps => ( +const renderInputComponent = React.forwardRef((inputProps, ref) => (
- +
custom stuff
-); +)); ```