You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im using material-ui to create my components, every time I click on something like a menu or a radio button that is supposed to change the view somehow I get:
Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs.
I wonder if this is a conflict with this particular library or if other react libraries suffer the same with nextjs.
Reacted by Ulises Giacoman, Damien Tsenkoff, Alexandre Chêne, Matt Apperson, Michal Sänger, Vlad Frolov, Valentin Hăloiu and Angelly
I got slightly further with react-toolbox, but without webpack to load the SASS, it won't work. One idea would be to convert all the SASS into CSS and then insert them into the page via <HEAD>. Haven't tried it though.
FYI, I have just reported an issue, which seems to reveal the root cause of the issue we encounter in most of the UI toolkits: #204. Please, have a look and maybe you will have a good guess of how this can be fixed.
I have succeeded in hacking Next.js to work with React-MD in #221, and it can be also hacked to work with Material-UI, but I have no idea on how to solve the hacks as I have a very little experience with NodeJS world. Thus, I put all my findings into the comments to the PR. I hope somebody will make sense out of my proof of concept and implement a proper PR.
@jonaswindey you got it, boostrap is different than matarial-ui in that css is separate and uses className to apply styles, material-ui uses inline styling applied to the components
The reason for this is obvious: why ship more CSS than is actually needed? eg: why ship an entire stylesheet of tools, inputs, textareas, radio buttons if you're only going to use a dropdown menu in a certain page?
Rebass is a React UI component library that uses inline styles to avoid CSS dependencies and prevent leaky global styles from affecting an application. Rebass components inherit styles where appropriate and can be customized using React Context. Rebass components are built as stateless functional components and modeled as presentational components
That said, our goal is to make the framework work with everything that works with React. For that we're exposing the webpack / babel config you can extend. The method we're going with is: #222
+1
Getting RangeError: Maximum call stack size exceeded on RaisedButton for the following line: var styles = getStyles(this.props, this.context, this.state); // 298
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.
Activity
ugiacoman commentedon Oct 29, 2016
@nsantini Any luck integrating Material-UI? I am facing a
Maximum call stack size exceedederror when implementing a RaisedButton component.nsantini commentedon Oct 31, 2016
Haven't been able to make it work with material-ui, I have been able to make it work with react-bootstrap though.
ugiacoman commentedon Oct 31, 2016
I got slightly further with react-toolbox, but without webpack to load the SASS, it won't work. One idea would be to convert all the SASS into CSS and then insert them into the page via
<HEAD>. Haven't tried it though.mattapperson commentedon Nov 1, 2016
Ran into this issue as well with material-ui... confused as to what the source might be though
frol commentedon Nov 4, 2016
Has anybody succeeded with any of the existing UI toolkit using Next.js?
frol commentedon Nov 5, 2016
FYI, I have just reported an issue, which seems to reveal the root cause of the issue we encounter in most of the UI toolkits: #204. Please, have a look and maybe you will have a good guess of how this can be fixed.
frol commentedon Nov 7, 2016
I have succeeded in hacking Next.js to work with React-MD in #221, and it can be also hacked to work with Material-UI, but I have no idea on how to solve the hacks as I have a very little experience with NodeJS world. Thus, I put all my findings into the comments to the PR. I hope somebody will make sense out of my proof of concept and implement a proper PR.
jonaswindey commentedon Nov 15, 2016
@nsantini how did you manage to get react-bootstrap working?
mattapperson commentedon Nov 15, 2016
@jonaswindey for me, it just worked... what sees to be your issue?
jonaswindey commentedon Nov 15, 2016
Nevermind, apparently you have to manually load the bootstrap from a CDN
mattapperson commentedon Nov 15, 2016
@jonaswindey did you add the css from react-bootstrap?
nsantini commentedon Nov 16, 2016
@jonaswindey you got it, boostrap is different than matarial-ui in that css is separate and uses className to apply styles, material-ui uses inline styling applied to the components
rauchg commentedon Nov 17, 2016
In general I recommend you load the CSS through
<Head>(more on this technique here: https://github.com/zeit/next.js/wiki/Global-styles-and-layouts), but as you can probably guess, the strength of Next.js is in using libraries that already bundle the CSS intelligently.The reason for this is obvious: why ship more CSS than is actually needed? eg: why ship an entire stylesheet of tools, inputs, textareas, radio buttons if you're only going to use a dropdown menu in a certain page?
For an example of this mindset check out http://jxnblk.com/rebass/ by @jxnblk
rauchg commentedon Nov 17, 2016
That said, our goal is to make the framework work with everything that works with React. For that we're exposing the webpack / babel config you can extend. The method we're going with is: #222
timneutkens commentedon Jan 15, 2017
Custom webpack config is now supported: https://github.com/zeit/next.js#customizing-webpack-config
@nsantini is this still an active issue? Otherwise it can be closed ❤️
timneutkens commentedon Jan 16, 2017
Closing in favor of custom webpack config. If your issue is not solved. Please do re-open this one. Or create a new one 👍
cyrus-za commentedon Jul 22, 2017
@timneutkens I am not sure what to do with my custom webpack config to fix this issue. #232
vozni4iy commentedon Aug 15, 2017
@cyrus-za do you manage to solve the issue with injectTapEventPlugin?
vozni4iy commentedon Aug 15, 2017
This helps
cyrus-za commentedon Aug 15, 2017
Thanks @vozni4iy that helps
sunlee-newyork commentedon Sep 29, 2017
+1
Getting
RangeError: Maximum call stack size exceededon RaisedButton for the following line:var styles = getStyles(this.props, this.context, this.state); // 298lock commentedon May 10, 2018
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.