UP | HOME

Date: <2023-11-03 Fri>

Graphics Shader

yarn add @shopify/react-native-skia
< Collapse code block> Expand code block
import React from "react";
import { Canvas, Skia, Shader, Fill} from "@shopify/react-native-skia";

const source = Skia.RuntimeEffect.Make(`
vec4 main(vec2 xy)
{
return vec4(1);
}
`)!;

function App(): JSX.Element {
    return (
        <Canvas style={{ flex: 1 }}>
            <Fill>
            <Shader source={source} />
        </Fill>
            </Canvas>
    );
}

export default App;

You can send your feedback, queries here