<!--
  Please provide a clear and concise description of what the bug is. Include
  screenshots if needed. Please test using the latest version of the relevant
  React packages to make sure your issue has not already been fixed.
-->

This was raised here: https://github.com/facebook/react/issues/11347#issuecomment-1002153792

I will open a PR to address this shortly. Please assign this bug to me.

React version: experimental

## Steps To Reproduce

1. Create a custom element with a property setter
2. Assign a function to that property

<!--
  Your bug will get fixed much faster if we can run your code and it doesn't
  have dependencies other than React. Issues without reproduction steps or
  code examples may be immediately closed as not actionable.
-->

Link to code example: https://jsfiddle.net/jarhar/df4k156b/

<!--
  Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a
  repository on GitHub, or provide a minimal code example that reproduces the
  problem. You may provide a screenshot of the application if you think it is
  relevant to your bug report. Here are some tips for providing a minimal
  example: https://stackoverflow.com/help/mcve.
-->

## The current behavior

The function does not get passed to the custom element setter

## The expected behavior

The function gets passed to the custom element setter

return node.getAttribute(attributeName);
        }
        if (propertyInfo.type === BOOLEAN) {
          
          
          return expected;
        }
        
        
        
        
        stringValue = node.getAttribute(attributeName);
      }
      if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
        return stringValue === null ? expected : stringValue;
        
      } else if (stringValue === '' + (expected: any)) {
        return expected;
      } else {
        return stringValue;
      }
    }
  }
}
/**
 * Get the value for a attribute on a node. Only used in DEV for SSR validation.
 * The third argument is used as a hint of what the expected value is. Some
 * attributes have multiple equivalent values.
 */
export function getValueForAttribute(