Skip to content
Advertisement

Tag: reactjs

Using ES Modules with babel-standalone

Quoting babel docs https://babeljs.io/docs/en/babel-standalone#usage : “If you want to use your browser’s native support for ES Modules, you’d normally need to set a type=”module” attribute on your script tag. With @babel/standalone, set a data-type=”module” attribute instead” For some reason though, when including my main index.js file (which imports other js / jsx files using import), it seems like babel is

React component state not updating with passed props

I have created an Accordion component which has data(object) and expanded(boolean) as props. expanded props is used to set the expanded/collapsed state of this component passed as a prop. Accordion component also has an internal state which is used for expanding/collapsing the accordion. Below is my complete component Accordion.jsx The parent component has a list of data and it loops

Material-ui v4 shows component names in html DOM class attributes?

After migrating from material-ui v3 to v4, noticed the react component/function name in the class attribute inside the HTML. Is that expected? Might this somehow affect overriding class properties already noticing issues when trying to override with new styles which do not apply. Also is there a possibility to remove those? The component names are: WrapperComponent, withRouter, CustomerDetailsContainer among others.

Advertisement