From 306afbe5c039e4e7fbe19101dcd248ec686d2326 Mon Sep 17 00:00:00 2001 From: a learning git Date: Thu, 10 Oct 2019 03:08:44 +0800 Subject: [PATCH] Add FrameContext types (#38996) For people who wants to use `hooks` like ```javascript import React, { useContext } from 'react' const { window: frameWindow } = useContext(FrameContext) ``` --- types/react-frame-component/index.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/react-frame-component/index.d.ts b/types/react-frame-component/index.d.ts index 2e0712472f..de4bee897c 100644 --- a/types/react-frame-component/index.d.ts +++ b/types/react-frame-component/index.d.ts @@ -17,11 +17,13 @@ export interface FrameComponentProps extends React.IframeHTMLAttributes {} -export interface FrameContext { +export interface FrameContextProps { document?: any; window?: any; } -export const FrameContextProvider: React.Provider; +export const FrameContext: React.Context; -export const FrameContextConsumer: React.Consumer; +export const FrameContextProvider: React.Provider; + +export const FrameContextConsumer: React.Consumer;