0

Whenever I add 'useStyles()' it forces to log any line two times.

Example:

function App() {
    console.log('1')
    const classes = useStyles()  // adding this logs in console '1' twice

    return (
        <Fragment/>
    )

Why it happens?

JayJayAbrams
  • 195
  • 1
  • 16

1 Answers1

0

by using the snippet below it actually renders once.

  useEffect(() => {
    console.log(count);
  });

full answer here

JayJayAbrams
  • 195
  • 1
  • 16