Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GridList] Remove style-propable mixin #3202

Merged
merged 1 commit into from
Feb 6, 2016

Conversation

newoga
Copy link
Contributor

@newoga newoga commented Feb 6, 2016

Noticed something in the code that I fixed, I leave a comment on that line.

},

componeneDidUpdate() {
componentDidUpdate() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the componentDidUpdate method was spelled wrong as componeneDidUpdate. Unless React's lifecycle methods support spelling checking, I'm guessing this wasn't doing anything 😆

I named it back, which obviously is changing the behavior. Though I'm thinking that the behavior is probably right to do that stuff on both mount and update.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you're implicitly fixing a reported issue. I don't remember it... but I'm sure this was affecting the behavior in a bad way. O.o

@alitaheri
Copy link
Member

All good 👍

@@ -105,16 +102,16 @@ const GridList = React.createClass({
}
const childCols = currentChild.props.cols || 1;
const childRows = currentChild.props.rows || 1;
const itemStyle = this.mergeStyles(styles.item, {
const itemStyle = Object.assign({}, styles.item, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering, why using Object.assign({}, styles. in some cases and Object.assign(, styles. in others?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, it wasn't necessary here. My faulty logic when I did this was because it's inside a loop of children and I didn't want styles.item to be mutated and contain data from other items so I decided to create an new object each time. But in this case the keys never change so they should always be overwritten so it should be safe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't noticed the loop 👍.
I would say let's keep our migration safe. We can tweak and improve stuff later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍

oliviertassinari added a commit that referenced this pull request Feb 6, 2016
[GridList] Remove style-propable mixin
@oliviertassinari oliviertassinari merged commit 4cf79f4 into mui:master Feb 6, 2016
@oliviertassinari
Copy link
Member

@newoga Thanks!

@newoga newoga deleted the #2852/grid-list branch February 6, 2016 23:21
@zannager zannager added the package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants