We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Current Behavior Type error when using PixiComponent with Text in typescript after upgrading the package version to below:
@pixi/react version: 7.1.1 pixi.js version: 7.3.1 @pixi/text version: 7.3.1
import { Text } from "@pixi/react"; . . . const style = new PIXI.TextStyle({}); const dragDropText = "Drag & drop a 3D model and resources to load it..."; <Text text={dragDropText} x={window.innerWidth / 2 - textMetrics.width / 2} y={window.innerHeight / 2 - textMetrics.height / 2} style={style} visible={!meshesLoaded} />
Type '{ text: string; x: number; y: number; style: TextStyle; visible: boolean; }' is not assignable to type 'IntrinsicAttributes & Partial<Omit<PixiText, any> & WithPointLike<P>> & WithSource & InteractionEvents & { ...; }'. Property 'text' does not exist on type 'IntrinsicAttributes & Partial<Omit<PixiText, any> & WithPointLike<P>> & WithSource & InteractionEvents & { ...; }'.ts(2322)
The Text component should render with no typescript errors, I actually followed the documentation example.
You can find a codesanbox here: https://codesandbox.io/s/magical-jang-wp3dtv?file=/src/App.tsx
Install the package version in a typescript react project
Create a small react & typescript component:
import { Stage, Container, Text } from '@pixi/react'; const MyComponent = () => { const style = new PIXI.TextStyle({}); return ( <Stage> <Container> <Text text="Hello World" x={400} y={330} style={style} /> </Container> </Stage> ); };
Remove text, style, etc from the omitted properties Partial<Omit<PixiText, any>
text
style
No response
The text was updated successfully, but these errors were encountered:
Same problem
Sorry, something went wrong.
No branches or pull requests
Current Behavior
Current Behavior
Type error when using PixiComponent with Text in typescript after upgrading the package version to below:
@pixi/react version: 7.1.1
pixi.js version: 7.3.1
@pixi/text version: 7.3.1
Expected Behavior
The Text component should render with no typescript errors, I actually followed the documentation example.
Steps to Reproduce
You can find a codesanbox here: https://codesandbox.io/s/magical-jang-wp3dtv?file=/src/App.tsx
Install the package version in a typescript react project
Create a small react & typescript component:
Environment
Possible Solution
Remove
text
,style
, etc from the omitted properties Partial<Omit<PixiText, any>Additional Information
No response
The text was updated successfully, but these errors were encountered: