-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
I am getting an error when using React.lazy:
Cannot call `React.lazy` with function bound to `component` because in the return value:
- Either a callable signature is missing in `Promise` [1] but exists in `React.StatelessFunctionalComponent` [2].
- Or `Promise` [1] is incompatible with statics of `React.Component` [3].
as an example:
const asyncGraphiQL = React.lazy(() =>
import(/* webpackChunkName: "graphiql" */ './containers/graphiql')
);
Should line be returning a promise instead?
declare export function lazy<P>(
component: () => Promise<{ default: React$ComponentType<P> }>,
): React$ComponentType<P>;