Basic Example
const Example = () => {
const { width, height } = useCanvasContext();
return (
<Rectangle
x={width * 0.1}
width={width * 0.8}
y={height * 0.25}
height={height * 0.5}
style={{ stroke: 'white', strokeWidth: 2 }}
>
<Text
x={width * 0.5}
y={height * 0.5}
style={{
fill: 'white',
align: 'center',
baseline: 'middle',
fontSize: 50,
}}
>
Hello, Async!
</Text>
</Rectangle>
);
};
const CanvasApp = () => (
<Canvas>
<Example />
</Canvas>
);