useState is not a default export from 'react'.
Try changing your imports from this:
import React from 'react' //import useState from 'react-dom'; import useState from 'react';
to this:
import React, { useState } from 'react'
Or you can simply use
React.useState()
without needing to import useState
useState
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
useState is not a default export from 'react'.
Try changing your imports from this:
to this:
Or you can simply use
without needing to import
useState