Skip to content

[@types/react] Add properties Suspense & lazy #30031

@eljenso

Description

@eljenso

React v.16.6 has been released and it brings lazy and Suspense.

Running tsc --build tsconfig.json throws:

src/components/DynamicComponent/index.tsx:28:24 - error TS2339: Property 'lazy' does not exist on type 'typeof React'.                                                      

28       component: React.lazy(() => import(this.state.url)),
                          ~~~~

src/components/DynamicComponent/index.tsx:46:14 - error TS2339: Property 'Suspense' does not exist on type 'typeof React'.

46       <React.Suspense fallback={<div>Loading...</div>}>
                ~~~~~~~~

src/components/DynamicComponent/index.tsx:55:15 - error TS2339: Property 'Suspense' does not exist on type 'typeof React'.

55       </React.Suspense>
                 ~~~~~~~~

@johnnyreilly @bbenezech @pzavolinsky

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions