registerComponent function

  1. @Deprecated('4.0.0')
ReactDartComponentFactoryProxy<Component> registerComponent(
  1. Component dartComponentFactory(
      ),
    1. {bool isWrapper = false,
    2. ReactDartComponentFactoryProxy<Component>? parentType,
    3. UiFactory<UiProps>? builderFactory,
    4. Type? componentClass}
    )

    Helper function that wraps react.registerComponent, and allows attachment of additional component factory metadata.

    • isWrapper: whether the component clones or passes through its children and needs to be treated as if it were the wrapped component.

    • builderFactory/componentClass: the UiFactory and UiComponent members to be potentially used as types for isComponentOfType/getComponentFactory.

    • displayName: (DEPRECATED) the name of the component for use when debugging.

    Deprecated. Use registerComponent2 instead.

    Implementation

    @Deprecated('4.0.0')
    ReactDartComponentFactoryProxy registerComponent(react.Component Function() dartComponentFactory, {
        bool isWrapper = false,
        // ignore: deprecated_member_use
        ReactDartComponentFactoryProxy? parentType,
        UiFactory? builderFactory,
        Type? componentClass,
    }) {
      // ignore: deprecated_member_use
      final reactComponentFactory = react.registerComponent(dartComponentFactory) as ReactDartComponentFactoryProxy;
    
      registerComponentTypeAlias(reactComponentFactory, builderFactory);
      registerComponentTypeAlias(reactComponentFactory, componentClass);
    
      setComponentTypeMeta(reactComponentFactory.type, isWrapper: isWrapper, parentType: parentType?.type);
    
      return reactComponentFactory;
    }