addUnconsumedDomProps method

void addUnconsumedDomProps(
  1. Map props
)

A prop modifier that passes a reference of a component's props to be updated with any unconsumed DomProps.

Call within modifyProps like so:

class SomeCompositeComponent extends UiComponent<SomeCompositeComponentProps> {
  @override
  render() {
    return (Dom.div()..modifyProps(addUnconsumedDomProps))(
      props.children,
    );
  }
}

Related addUnconsumedProps

Implementation

void addUnconsumedDomProps(Map props) {
  var consumedPropKeys = consumedProps?.map((consumedProps) => consumedProps.keys) ?? const [];

  forwardUnconsumedProps(this.props, propsToUpdate: props, keySetsToOmit:
      consumedPropKeys, onlyCopyDomProps: true);
}