Skip to content

1.0Beta docs? #234

Answered by michalochman
linonetwo asked this question in Q&A
Aug 15, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Hi @linonetwo, the usage is the same in general with an exception of only two small differences:

  1. Using ref with <Stage /> component.
  2. Using react-pixi-fiber with animated or react-spring.

1. ref with <Stage />

If you wanted to manually access PIXI.Application with reference to Stage, then you would do:

react-pixi-fiber@0.14.3

function SomePixiApp() {
  const stageRef = useRef<typeof Stage | null>(null)

  useEffect(() => {
    const app = stageRef.current._app;
    console.log("PIXI.Application", { app });
  }, [])

  return <Stage ref={stageRef} />
}

react-pixi-fiber@1.0.0

function SomePixiApp() {
  const stageRef = useRef<typeof Stage | null>(null)

  useEffect(() => {
-    const app …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@linonetwo
Comment options

@michalochman
Comment options

Answer selected by michalochman
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants