Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Material-UI CSS not injected #106

Closed
saraivinha85 opened this issue Mar 20, 2020 · 3 comments
Closed

Material-UI CSS not injected #106

saraivinha85 opened this issue Mar 20, 2020 · 3 comments
Assignees
Labels
Bug Something isn't working

Comments

@saraivinha85
Copy link

saraivinha85 commented Mar 20, 2020

Describe the bug
Material-UI CSS not injected when components are rendered after first mount.

To reproduce
Working code:

render() {
        const buttons = ['Hello'].map((p) => <Button variant="contained" color="primary" key={p}>p</Button>)

        return (
            <div style={styles.root} > 
                {buttons}
            </div>
        )
    }

Not working code (labels are injected later using redux):

render() {
            const { labels = [] } = this.props.labels
        const buttons = labels.map((p) => <Button variant="contained" color="primary" key={p}>p</Button>)

        return (
            <div style={styles.root} > 
                    {buttons}
            </div>
        )
    }

Expected behavior
The buttons should appear styled.

@saraivinha85 saraivinha85 added the Bug Something isn't working label Mar 20, 2020
@SimonHoiberg
Copy link
Member

Thanks for creating this issue.
We will look into this as soon as possible.

@saraivinha85
Copy link
Author

Take a look at this example:
https://github.com/saraivinha85/direflow-MUI-CSS-bug/

@SimonHoiberg
Copy link
Member

Hi @saraivinha85
This issue has been fixed in version 3.4.5.
I have verified it on your reproduction repo.

Thanks for creating this issue 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants