Created
October 14, 2020 19:48
-
-
Save ljmotta/70d452288a46fc6e69b3dd7940f0c33d to your computer and use it in GitHub Desktop.
PingPongEnvelopeView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface PingPongEnvelopeViewApi { | |
setView(page: PingPong): Promise<void>; | |
} | |
export const PingPongEnvelopeView = React.forwardRef((props, forwardedRef) => { | |
const [view, setView] = useState<PingPong>(); | |
useImperativeHandle(forwardedRef, () => ({ setView: setView }), []); | |
return ( | |
<div className={"ping-pong-view--main"}> | |
{view && ( | |
<> | |
<h2>This is an implementation of Ping-Pong View</h2> | |
<p className={"ping-pong-view--p-iframe"}> The {"<iframe>"} border is green </p> | |
<p className={"ping-pong-view--p-ping-pong"}> The Ping-Pong View implementation border is red </p> | |
<div id={"ping-pong-view-container"} className={"ping-pong-view-container"}> | |
{view?.reactComponent?.()} | |
</div> | |
</> | |
)} | |
</div> | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment