Skip to content

Commit

Permalink
use Future.sync JIC
Browse files Browse the repository at this point in the history
  • Loading branch information
kealjones-wk committed Sep 30, 2024
1 parent 2aea069 commit b552b7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/react_client/lazy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ReactComponentFactoryProxy lazy(Future<ReactComponentFactoryProxy> Function() lo
final hoc = React.lazy(
allowInterop(
() => futureToPromise(
(() async {
Future.sync(() async {
final factory = await load();
// By using a wrapper uiForwardRef it ensures that we have a matching factory proxy type given to react-dart's lazy,
// a `ReactDartWrappedComponentFactoryProxy`. This is necessary to have consistent prop conversions since we don't
Expand All @@ -54,7 +54,7 @@ ReactComponentFactoryProxy lazy(Future<ReactComponentFactoryProxy> Function() lo
);
});
return jsify({'default': wrapper.type});
})(),
}),
),
),
);
Expand Down

0 comments on commit b552b7d

Please sign in to comment.