Just upgraded to typescript 4.2.2 and started receiving following warning for all my react imports i.e.
import React from "react";
Causes this warning
'React' is declared but its value is never read
This import was working fine before and is required to use jsx as far as I am aware. I looked at the change log, but didn't see any changes related to this new warning. My tsconfig also has "jsx": "react-jsx"
Any advice on how to resolve this?
In my case I had no access to babel, however was able to fix this via following webpack plugin
plugins: [
new webpack.ProvidePlugin({
React: 'react'
})
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With