Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-konva のコンポーネントに Context を渡せない #11

Closed
okathira opened this issue Feb 22, 2021 · 1 comment · Fixed by #12
Closed

react-konva のコンポーネントに Context を渡せない #11

okathira opened this issue Feb 22, 2021 · 1 comment · Fixed by #12
Labels
wontfix This will not be worked on

Comments

@okathira
Copy link
Owner

boxesProps: BoxProps[]; // TODO: コンテキストにするとレンダリングされないのを治す

const OutputArea: React.FC<{
layoutSize: RectSize;
baseCanvas: CanvasImageSource;
}> = ({ layoutSize, baseCanvas }) => {
// TODO: 子に渡しているだけのため消したい
const boxesProps = useBoxesProps();
return (
<Stage
className="output-area"
width={layoutSize.width}
height={layoutSize.height}
>
<Layer>
<Image image={baseCanvas} />
<ClippingBoxes currentFrame={baseCanvas} boxesProps={boxesProps} />
</Layer>
</Stage>
);
};

Context が常に初期値になってた

Context<canvas> を通らない
facebook/react#13336
facebook/react#13332 (comment)
Context<Layer> 以下のような dom に属さないコンポーネントまでたどり着かない

ブリッジさせるしかないらしい
konvajs/react-konva#188 (comment)
facebook/react#17275 (comment)

@okathira okathira added the wontfix This will not be worked on label Feb 22, 2021
@okathira okathira linked a pull request Feb 22, 2021 that will close this issue
@okathira
Copy link
Owner Author

github のほうのドキュメントに普通に書いてあった
https://github.com/konvajs/react-konva#usage-with-react-context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant