Can not use material-ui components inside React4s components
See original GitHub issueSteps:
- add cdn for material-ui in index.html of react4s-samples
<script src="https://unpkg.com/@material-ui/core/umd/material-ui.production.min.js" crossorigin="anonymous"></script>
- Create a react4s wrapper for Button component
import com.github.ahnfelt.react4s.JsComponent
import scala.scalajs.js
object Button extends JsComponent(js.Dynamic.global.Button)
- Use the Button wrapper in Main.scala as following
ReactBridge.renderToDomById(Button(), "main")
- fastOptJS and reload the index.html
We get the error:
Uncaught Error: Minified React error #130; visit http://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at ze (react-dom.production.min.js:82)
at l (react-dom.production.min.js:12)
at ec (react-dom.production.min.js:46)
at react-dom.production.min.js:61
at k (react-dom.production.min.js:129)
at h (react-dom.production.min.js:129)
at beginWork (react-dom.production.min.js:137)
at e (react-dom.production.min.js:168)
at f (react-dom.production.min.js:169)
at A (react-dom.production.min.js:175)
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Material UI components not working in React JS project
Try import Button from '@mui/material/Button'; ... Component { return ( <div className="App"> <h1>COVID-19 ... Please use this command.
Read more >Material UI v4 is out - MUI
Material UI v4 has finally arrived. We are so excited about this release, as it defines better foundations for the UI components.
Read more >How to Implement Material-UI in React - Section.io
We must install the Material-UI to access its different functionalities or components. Open your terminal, and ensure that you are inside your ...
Read more >Uncontrolled Components - React
In React, an <input type="file" /> is always an uncontrolled component because its value can only be set by a user, and not...
Read more >5 React Material UI Features You Might Have Missed
Just to give you an overview, Material UI doesn't limit you to only JSS based styling. If you love using Styled-Components or CSS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I had the same issue. try this:
NpmReactBridge borrowed from @Taig’s library
@avitaln Yes. plugins.sbt is exact same. I tried putting bundle JS after main div as well. Still getting same error as in #11.
@Taig I will refer to react4s-mui. Thank you.