Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] makeStyles demo is broken #13680

Closed
2 tasks done
joshwooding opened this issue Nov 23, 2018 · 11 comments
Closed
2 tasks done

[docs] makeStyles demo is broken #13680

joshwooding opened this issue Nov 23, 2018 · 11 comments
Labels
docs Improvements or additions to the documentation

Comments

@joshwooding
Copy link
Member

joshwooding commented Nov 23, 2018

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

makeStyles() codesandbox demo should work

Current Behavior 😯

It currently errors with: _react.default.useContext is not a function

Steps to Reproduce 🕹

Link: https://codesandbox.io/s/0mpw102k00

Your Environment 🌎

Tech Version
Material-UI v3.5.1
React
Browser
TypeScript
etc.

Demo needs to be updated to use react 16.7.0 alpha

@oliviertassinari

This comment has been minimized.

@joshwooding
Copy link
Member Author

@oliviertassinari https://codesandbox.io/s/0mpw102k00 I meant this demo. The docs demo works fine but the edit in codesandbox doesn't work

@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 23, 2018

@joshwooding Oh right, people can't just click on the edit button, they also have to change the react version:

{
  "title": "Material demo",
  "description": "https://github.com/mui-org/material-ui/blob/master/docs/src/pages/css-in-js/basics/Hook.js",
  "dependencies": {
-   "react-dom": "latest",
-   "react": "latest",
+   "react-dom": "next",
+   "react": "next",
    "@material-ui/styles": "latest",
    "@material-ui/core": "latest"
  }
}

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Nov 23, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 23, 2018

We can add an option for it, like this:

-{{"demo": "pages/css-in-js/basics/StyledComponents.js"}}
+{{"demo": "pages/css-in-js/basics/StyledComponents.js", "react": "next"}}

@oliviertassinari
Copy link
Member

@joshwooding What do you think? Do you want to handle it? :)

@joshwooding
Copy link
Member Author

@oliviertassinari I can have a go :)

@mkaschke
Copy link

mkaschke commented Jan 3, 2019

@joshwooding - the Demo is still not working "_react.default.useContext is not a function"

@joshwooding
Copy link
Member Author

joshwooding commented Jan 3, 2019

@mkaschke The makeStyles demo works for me https://codesandbox.io/s/ywj9v6lz9v
There's a reported issue with the other hook demos that should be fixed soon #14063

@oliviertassinari
Copy link
Member

@mkaschke _react.default.useContext is not a function means that your React version doesn't support Hooks.

@mkaschke
Copy link

mkaschke commented Jan 4, 2019

@joshwooding - your link works fine but the link on https://material-ui.com/demos/app-bar/ (under App Bar with menu) -> https://codesandbox.io/s/5kro05m06l is not working

@mkaschke
Copy link

mkaschke commented Jan 4, 2019

@oliviertassinari - thank you for your answer, I already fixed it for my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

3 participants