Skip to content

AppThemeProvider.render(): A valid React element (or null) must be returned.  #19

@Extra-lightwill

Description

@Extra-lightwill

I've been looking at the 'next' branch in MUI (https://github.com/callemall/material-ui/tree/next) and would like to use a similar pattern to implement theming in my own application.

I've adapted the MUI next branch code in styles folder (https://github.com/callemall/material-ui/tree/next/src/styles) to suit the needs of my own application but pretty much stuck to the same core structure.

However, I'm running into errors and I'm wondering if you could help me out or at least point me in the right direction for a solution and maybe give an explanation of why it is occurring.

The error (which i assume is something to do with this.props.children from my ThemeProvider component but I'm not exactly sure what):

Server error: renderOnServer render function failed Invariant Violation: AppThemeProvider.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.

2nd error Server error: renderOnServer render function failed TypeError: document.querySelector is not a function - this is a server-side rendering issue because node can't perform DOM manipulations but I'm unsure how to get around it

Additional info: My application is Isomorphic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions