function addDefaultPropsToComponent(component, defaultProps) {
    // Early return if this component's defaultProps is already marked as "unresolved".
    if (component.defaultProps === 'unresolved') {
      return;
    }

    if (defaultProps === 'unresolved') {
      markDefaultPropsAsUnresolved(component);
      return;
    }

    const defaults = component.defaultProps || {};
    const newDefaultProps = Object.assign(
      {},
      defaults,
      fromEntries(defaultProps.map((prop) => [prop.name, prop]))
    );

    components.set(component.node, {
      defaultProps: newDefaultProps,
    });
  }
Adds defaultProps to the component passed in.
@param   {ASTNode}         component    The component to add the defaultProps to.
@param   {Object[]|'unresolved'} defaultProps defaultProps to add to the component or the string "unresolved"
                                        if this component has defaultProps that can't be resolved.
@returns {void}