Material-ui: @material-ui/lab/esm/TreeView/TreeView.js Attempted import error: 'useControlled' is not exported from '@material-ui/core/utils'.

Created on 23 Jan 2020  路  10Comments  路  Source: mui-org/material-ui

  • [X] The issue is present in the latest release.
  • [X] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

Expected Behavior 馃

Steps to Reproduce 馃暪

Steps:

  1. install core and labs
  2. use demo TreeView & TreeItem code Sample Code Here

Context 馃敠

I am having issues using the TreeView example code. It keeps giving me 'useControlled' is not exported from '@material-ui/core/utils'. It seems to be broken on the CodeSandbox example as well. Any insight on this would be great

CodeSandbox

Your Environment 馃寧

| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.8.3 |
| React | v16.12.0 |
| Browser | Chrome 79.0.3945.88 |
| TypeScript | 3.7.2 |
| @material-ui/lab | 4.0.0-alpha.40 |

TreeView question

Most helpful comment

The version @material-ui/lab | 4.0.0-alpha.40 should be working with Material-UI | v4.9.0 not v4.8.3. Try to update your version to 4.9.0 or downgrade lab to 4.0.0-alpha.39

All 10 comments

@crofoot just resolved the same issue for me. Change version of @material-ui/lab to 4.0.0-alpha.39

This crops up in Autocomplete, too, whichever 4.x release I use.

The version @material-ui/lab | 4.0.0-alpha.40 should be working with Material-UI | v4.9.0 not v4.8.3. Try to update your version to 4.9.0 or downgrade lab to 4.0.0-alpha.39

@laptopche has answered the issue in https://github.com/mui-org/material-ui/issues/19360#issuecomment-578325957. Check the peer dependency warning.

I'm using Autocomplete component, and I'm having the same error:

./node_modules/@material-ui/lab/esm/useAutocomplete/useAutocomplete.js
Attempted import error: 'useControlled' is not exported from '@material-ui/core/utils'.

My environments:

"react-dom": "latest",
"react": "latest",
"@material-ui/lab": "4.0.0-alpha.41",
"@material-ui/icons": "latest",
"@material-ui/core": "4.9.1",

@oliviertassinari Could you please help me with this? Thanks in advance.

@Ergouzii could you try to downgrade version of "@material-ui/lab" to "4.0.0-alpha.40" or "4.0.0-alpha.39" if it won't work

Not working. I Changed the version to "@material-ui/lab": "4.0.0-alpha.39", and it did'nt worked for me.
same error

@Ergouzii could you try to downgrade version of "@material-ui/lab" to "4.0.0-alpha.40" or "4.0.0-alpha.39" if it won't work

Downgrading to 4.0.0-alpha.39 works for me! Thanks!

Not working. I Changed the version to "@material-ui/lab": "4.0.0-alpha.39", and it did'nt worked for me.
same error

If it helps, I was having this problem with the autocomplete component and, while alpha.39 gave me the same issue, alpha.40 solved it

Upgrade dependencies to

"@material-ui/core": "4.9.4",
"@material-ui/icons": "4.9.1",
"@material-ui/pickers": "3.2.10",
"react": "16.12.0",
"react-dom": "16.12.0",

devDependecies

"@types/react": "16.9.22",
"@types/react-dom": "16.9.5",

Was this page helpful?
0 / 5 - 0 ratings