E
E
eugenedrvnk2022-03-23 18:21:34
React
eugenedrvnk, 2022-03-23 18:21:34

How to create a type for a react component with ref support?

I have created a small demo here .

I have a basic "Button" component (in "src/components").
"Button.type.ts" contains type definitions through which communication with the rest of the application will take place.
"Button.component.tsx" implements this type.

But what to do when it becomes necessary to define support for ref-throwing in a component, how then to define this type?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question