Skip to content

Issues with libraries #119

Closed
Closed

Description

@nsantini

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.

Activity

  1. ugiacoman commented on Oct 29, 2016

    @ugiacoman

    @nsantini Any luck integrating Material-UI? I am facing a Maximum call stack size exceeded error when implementing a RaisedButton component.

  2. nsantini commented on Oct 31, 2016

    @nsantini
    Author

    Haven't been able to make it work with material-ui, I have been able to make it work with react-bootstrap though.

  3. ugiacoman commented on Oct 31, 2016

    @ugiacoman

    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.

  4. mattapperson commented on Nov 1, 2016

    @mattapperson

    Ran into this issue as well with material-ui... confused as to what the source might be though

  5. frol commented on Nov 4, 2016

    @frol
    Contributor

    Has anybody succeeded with any of the existing UI toolkit using Next.js?

  6. frol commented on Nov 5, 2016

    @frol
    Contributor

    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.

  7. frol commented on Nov 7, 2016

    @frol
    Contributor

    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.

  8. jonaswindey commented on Nov 15, 2016

    @jonaswindey
    Contributor

    @nsantini how did you manage to get react-bootstrap working?

  9. mattapperson commented on Nov 15, 2016

    @mattapperson

    @jonaswindey for me, it just worked... what sees to be your issue?

  10. jonaswindey commented on Nov 15, 2016

    @jonaswindey
    Contributor

    Nevermind, apparently you have to manually load the bootstrap from a CDN

  11. mattapperson commented on Nov 15, 2016

    @mattapperson

    @jonaswindey did you add the css from react-bootstrap?

  12. nsantini commented on Nov 16, 2016

    @nsantini
    Author

    @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

  13. rauchg commented on Nov 17, 2016

    @rauchg
    Member

    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

    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

  14. rauchg commented on Nov 17, 2016

    @rauchg
    Member

    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

  15. timneutkens commented on Jan 15, 2017

    @timneutkens
    Contributor

    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 ❤️

  16. timneutkens commented on Jan 16, 2017

    @timneutkens
    Contributor

    Closing in favor of custom webpack config. If your issue is not solved. Please do re-open this one. Or create a new one 👍

  17. cyrus-za commented on Jul 22, 2017

    @cyrus-za

    @timneutkens I am not sure what to do with my custom webpack config to fix this issue. #232

  18. vozni4iy commented on Aug 15, 2017

    @vozni4iy

    @cyrus-za do you manage to solve the issue with injectTapEventPlugin?

  19. vozni4iy commented on Aug 15, 2017

    @vozni4iy
    var reactDomLibPath = path.join(__dirname, "./node_modules/react-dom/lib");
    var alias = {};
    ["EventPluginHub", "EventConstants", "EventPluginUtils", "EventPropagators",
     "SyntheticUIEvent", "CSSPropertyOperations", "ViewportMetrics"].forEach(function(filename){
        alias["react/lib/"+filename] = path.join(__dirname, "./node_modules/react-dom/lib", filename);
    });
    
    config.resolve = {
          alias: alias
        }
    

    This helps

  20. cyrus-za commented on Aug 15, 2017

    @cyrus-za

    Thanks @vozni4iy that helps

  21. sunlee-newyork commented on Sep 29, 2017

    @sunlee-newyork

    +1
    Getting RangeError: Maximum call stack size exceeded on RaisedButton for the following line:
    var styles = getStyles(this.props, this.context, this.state); // 298

  22. lock commented on May 10, 2018

    @lock

    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.

  23. locked as resolved and limited conversation to collaborators on May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions