A syntax for function declarations to "implement" types (like const C: React.FC<Props> = (props0) => ...
)
#39039
Closed
5 tasks done
Labels
Duplicate
An existing issue was already created
Search Terms
function,implements,type,interface
Suggestion
I'd like to make a
function
to implement types or interfaces. It is partially possible for variable declaration (e.g.const f: T = () => ...
) but it is slightly different from what I'm issuing.Use Cases & Examples
When making a React component.
It is a good practice to use
React.FC<Props>
when you make a React component like this:It's useful because a function component with a wrong return type doesn't compile. However, I think it's natural if I can declare implementing types for
function
declarations like this:(syntax doesn't matter; just for example)
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: