From 39f08a0b72a7247113c7107b694e7a30c43ca738 Mon Sep 17 00:00:00 2001 From: William Candillon Date: Wed, 18 Dec 2024 14:47:53 +0100 Subject: [PATCH] =?UTF-8?q?chore(=F0=9F=93=9A):=20remove=20manual=20contex?= =?UTF-8?q?t=20injection=20example=20(#2815)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #2777 --- apps/docs/docs/canvas/contexts.md | 33 ------------------------------- 1 file changed, 33 deletions(-) diff --git a/apps/docs/docs/canvas/contexts.md b/apps/docs/docs/canvas/contexts.md index 0f938a3e13..d4c4d0b9c5 100644 --- a/apps/docs/docs/canvas/contexts.md +++ b/apps/docs/docs/canvas/contexts.md @@ -13,39 +13,6 @@ However, if you need to use a React context within your drawing, you must re-inj We found [its-fine](https://github.com/pmndrs/its-fine), also used by [react-three-fiber](https://github.com/pmndrs/react-three-fiber), to provide an elegant solution to this problem. -## Manual Context Injection - -```tsx twoslash -import React from "react"; -import { Canvas, Fill } from "@shopify/react-native-skia"; -import {useTheme, ThemeProvider} from "./docs/getting-started/Theme"; - -const MyDrawing = () => { - const { primary } = useTheme(); - return ; -}; - -export const Layer = () => { - const theme = useTheme(); - return ( - - {/* We need to re-inject the context provider here. */} - - - - - ); -}; - -export const App = () => { - return ( - - - - ); -}; -``` - ## Using `its-fine` ```tsx twoslash