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.forwardRef example #541

Open
basarat opened this issue Dec 2, 2019 · 0 comments
Open

React.forwardRef example #541

basarat opened this issue Dec 2, 2019 · 0 comments

Comments

@basarat
Copy link
Owner

basarat commented Dec 2, 2019

type RenderedViewProps = { url: string };
const RenderedView: React.FC<RenderedViewProps> = React.forwardRef<HTMLIFrameElement, RenderedViewProps>((props, ref) => {
  return <iframe ref={ref} src={props.url} style={{
    width: '100%',
    border: 'none',
    backgroundColor: 'white',
  }} />
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant