'Conflict with React types when building with tsc

I am trying to build an NPM package with TypeScript, not a normal React project.

When I run tsc to build the project, it returns many type errors: It seems to be in conflicting with react types.

Have a doubt, should the react version match its @types version?

image error



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source