Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add types to React$Context in flow

import { createContext } from 'react'

type props = {
	name: string,
	age: number,
}

export const MyContext: React$Context<props> = createContext({})
export const MyContextProvider = MyContext.Provider
 
PREVIOUS NEXT
Tagged: #add #types #flow
ADD COMMENT
Topic
Name
5+9 =