Bug: BitmapText style not changing when style
prop changes
#462
Labels
v7
Issues related to Pixi React v7
style
prop changes
#462
Current Behavior
When I change the
style
property of aBitmapText
component, e.g. by creating a new object, the rendered output does not update accordingly.Expected Behavior
When the component re-renders with an updated
style
property, I expect the style in the rendered bitmap text object to be updated accordinglySteps to Reproduce
https://codesandbox.io/s/mystifying-taussig-jykccy?file=/src/App.js
Environment
@pixi/react
version: 7.1.1pixi.js
version: 7.3.2React
version: 18.2.0ReactDOM
version: 18.2.0Possible Solution
A workaround is to specify those properties explicitly, e.g.
<BitmapText text="whatever" fontName={fontName} style={{fontName}} />
The issue is that on first render the
style
prop is required, but to update it we need to explicitly provide thefontName
prop, which is confusing.Additional Information
No response
The text was updated successfully, but these errors were encountered: