JayJayAbrams
JayJayAbrams

Reputation: 195

Material ui useStyles() logs two times

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?

Upvotes: 0

Views: 113

Answers (1)

JayJayAbrams
JayJayAbrams

Reputation: 195

by using the snippet below it actually renders once.

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

full answer here

Upvotes: 0

Related Questions