I was following this tutorial on using React.forwardRef, where make this component:
import React from "react";
const Search = React.forwardRef<HTMLInputElement>((props, ref) => {
return <input ref={ref} type="search" />;
});
export default Search;
However, running my app, the component causes the following error:
Component definition is missing display name react/display-name
Based on this question, I thought I might do something like this:
const Search = MySearch = React.forwardRef<HTMLInputElement>((props, ref) => {
return <input ref={ref} type="search" />;
});
export default Search;
But this did not fix the problem either.
So then, how can I give my component a display name?