Capítulo 76 de 988

Chapter 76: useCurrentScale()

Core Idea

With this hook, you can retrieve the scale factor of the canvas. Useful for if you want to measure DOM nodes.

Key Concepts

  • Compatibility
  • See also

Code Examples

const MyVideo = () => {
  const scale = useCurrentScale();

  return <div>The current scale is {scale}</div>;
};
  • What it demonstrates: Usage pattern for useCurrentScale() from the official docs.

Key Takeaways

  1. Understand compatibility when working with useCurrentScale().
  2. Understand see also when working with useCurrentScale().

Connects To

  • Cancel Render: related page in the Hooks & Data APIs section.
  • Continue Render: related page in the Hooks & Data APIs section.
  • Data Fetching: related page in the Hooks & Data APIs section.