I am attempting to write a cordova app with ts and react by starting with the boilerplate: https://github.com/davidgerrard/cordova-react-typescript-webpack-boilerplate
The cloned code works fine, but when I attempt to write my own component I start with a typical:
import React, { useState } from 'react';
It imports React just fine, but tells me
Module '"react"' has no exported member 'useState'
I am used to react on the web, so is there some different way to do this for cordova? Or is there something that may need to be configured and/or updated?
TL;DR? User zero298 nailed it.
If you ever get this error it is because you are using an old pre-hooks version of React.
The easiest fix is to simply run "npm upgrade" (or yarn, or whatever your preferred package manager is)
I hope others googling this error can learn from my mistakes.