“Could not find a declaration file for module component”

May 15, 2020

If you get the error message: “Could not find a declaration file for module component” and the path to the component is underlined in red, instead of importing the component as normal, require it. Make sure to add default at the end.

const YourComponent = require("../path/to/YourComponent").default