Skip to content

Commit

Permalink
address more feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kealjones-wk committed Oct 1, 2024
1 parent b5289ec commit dbf8c32
Show file tree
Hide file tree
Showing 5 changed files with 397 additions and 1,281 deletions.
6 changes: 3 additions & 3 deletions lib/src/util/lazy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ UiFactory<TProps> lazy<TProps extends UiProps>(

final lazyFactoryProxy = react.lazy(() 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,
// By using a wrapper uiForwardRef 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
// have access to the original factory proxy outside of this async block.
final wrapper = uiForwardRef<TProps>(
Expand All @@ -91,8 +91,8 @@ UiFactory<TProps> lazy<TProps extends UiProps>(
: builder(props.children);
},
UiFactoryConfig(
propsFactory: PropsFactory.fromUiFactory(factory),
displayName: _config.displayName != null ? 'Lazy(${_config.displayName}' : 'LazyComponent'
propsFactory: propsFactory,
displayName: _config.displayName != null ? 'lazy(${_config.displayName})' : 'lazy(anonymous)'
),
);
return wrapper().componentFactory!;
Expand Down
Loading

0 comments on commit dbf8c32

Please sign in to comment.