user2986749
user2986749

Reputation: 53

Why to upgrade React on upgrading Material UI

I need to upgrade Material UI from version V0 to V4. I am using react version 15. Do I need to upgrade React also? Why?

Upvotes: 0

Views: 78

Answers (1)

Ido
Ido

Reputation: 5748

Material-ui V4 is using React Hooks. It was added in react 16.8:

Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.

So when migrating to material-ui v4, you must upgrade react to version > 16.8,
because material-ui v4 relies on hooks.

You can refer to the migration docs:

  1. Migration to v1
  2. V3 release docs
  3. Migration to v4

Upvotes: 2

Related Questions