--!strict -- ROBLOX upstream: https://github.com/facebook/react/blob/56e9feead0f91075ba0a4f725c9e4e343bca1c67/packages/react/src/index.js --[[* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow *]] -- ROBLOX deviation: simulates `index.js` and exports React's public interface local Packages = script.Parent local LuauPolyfill = require(Packages.LuauPolyfill) export type Object = LuauPolyfill.Object local React = require(script.React) -- ROBLOX deviation START: bindings support export type Binding = React.ReactBinding export type BindingUpdater = React.ReactBindingUpdater -- ROBLOX deviation END local ReactLazy = require(script.ReactLazy) export type LazyComponent = ReactLazy.LazyComponent local SharedModule = require(Packages.Shared) export type StatelessFunctionalComponent

= SharedModule.React_StatelessFunctionalComponent

-- ROBLOX deviation START: we use the definitely-typed version of this, which appears to work for flowtype in VirtualizedList, etc export type ComponentType

= ComponentClass

| FC

-- ROBLOX deviation END export type AbstractComponent = SharedModule.React_AbstractComponent< Config, Instance > export type ElementType = SharedModule.React_ElementType export type Element = SharedModule.React_Element export type Key = SharedModule.React_Key export type Ref = SharedModule.React_Ref export type Node = SharedModule.React_Node export type Context = SharedModule.ReactContext -- ROBLOX TODO: Portal export type ElementProps = SharedModule.React_ElementProps export type ElementConfig = SharedModule.React_ElementConfig export type ElementRef = SharedModule.React_ElementRef -- ROBLOX TODO: Config -- ROBLOX TODO: ChildrenArray -- ROBLOX deviation START: manual type exports since that's not free with 'return React' export type ComponentClass

= SharedModule.React_ComponentType

export type PureComponent = React.PureComponent -- ROBLOX deviation END -- ROBLOX deviation START: definitelytyped typescript exports export type ReactElement = SharedModule.ReactElement< Props, ElementType > -- we don't include ReactText in ReactChild since roblox renderer doesn't support raw text nodes export type ReactChild = SharedModule.ReactElement | string | number export type FC

= SharedModule.React_StatelessFunctionalComponent

export type ReactNode = SharedModule.React_Node -- ROBLOX deviation END -- ROBLOX deviation START: export React types that are flowtype built-ins and used by VirtualizedList, etc export type React_AbstractComponent = SharedModule.React_Component< Props, Instance > export type React_FowardRefComponent = SharedModule.React_ForwardRefComponent export type React_MemoComponent = SharedModule.React_MemoComponent export type React_Component = SharedModule.React_Component export type React_ComponentType

= SharedModule.React_ComponentType

export type React_Context = SharedModule.React_Context export type React_Element = SharedModule.React_Element export type React_ElementType = SharedModule.React_ElementType export type React_Node = SharedModule.React_Node -- ROBLOX deviation END return React