https://codesandbox.io/s/react-16-s4dxs
import React, { useRef } from "react";
import { render } from "react-dom";
import Autosuggest from "react-autosuggest";
const styles = {
fontFamily: "sans-serif",
textAlign: "center"
};
const Wrapper = () => {
const inputRef = useRef();
return <App ref={inputRef} />;
};
const inputProps = {
placeholder: "",
value: "",
"de-di-var": "",
onChange: (event, { newValue }) => {
console.log("change");
},
label: "",
feedback: null,
error: null
};
const App = React.forwardRef(({ error }, ref) => {
return (
<div style={styles}>
<h4>Reference</h4>
<Autosuggest
inputProps={inputProps}
ref={ref}
suggestions=""
undefined={false}
/>
</div>
);
});
render(<Wrapper />, document.getElementById("root"));
Ok, so I tried various things in order to add a valueless attribute such that I get something like: and not and I couldn't come with any solution. Obviously, I can add it manually to the input DOM element, but that's modifying a public library, which is not a good solution obviously. Is there a way to do this? I have tried to setting the value to undefined, null, "", and I tried other methods as well, which I won't detail here, but it seems that the library simply doesn't support it.