I'd like to use componentDidMount()
, but I have a const with a interface prop. Is there a way to do this in typescript?
interface DataCardProps { onPress: () => void;}const Covid19DataCard = ({ onPress }: DataCardProps) => {
export default class Covid19DataCard extends React.Component { componentDidMount()}