ClassName attribute does not replace destructured one if defined after
ivanblinov2k17 opened this issue · comments
Observed Behaviour
Unlike React, if we pass the className attribute after destructured className, destructured will be applied
class App extends Component {
render() {
return (
<div className="App">
<div {...this.someAttrs} className="divClass">asd</div>
</div>
);
}
get someAttrs(){
return {className: "getterClass"}
}
}
We will get in DOM
<div class="getterClass">asd</div>
I guess this behaviour can be related with work of normalizeProps function.
There is a functional call
(0, _inferno.normalizeProps)((0, _inferno.createVNode)(1, "div", "divClass", "asd", 16, _extends({}, model.someAttrs)));
And the position of the className attribute does not matter
Expected Current Behaviour
Inferno should apply the last className value ('divClass')
HI,
Thanks for reporting this issue. It indeed looks like a bug. I will investigate this
Yep, it was indeed a bug. Its now fixed in the master branch and will be available in the next release
Do you have any info about the date of the next release?
Oh heck. I had forgotten this was never released. I will make hotfix for it
Sorry for the delay, this fix is now available in inferno v7.4.9