function isComponentInRenderProp(node, context, propNamePattern) {
  if (
    node
    && node.parent
    && node.parent.type === 'Property'
    && node.parent.key
    && propMatchesRenderPropPattern(node.parent.key.name, propNamePattern)
  ) {
    return true;
  }

  // Check whether component is a render prop used as direct children, e.g. <Component>{() => <div />}</Component>
  if (
    node
    && node.parent
    && node.parent.type === 'JSXExpressionContainer'
    && node.parent.parent
    && node.parent.parent.type === 'JSXElement'
  ) {
    return true;
  }

  const jsxExpressionContainer = getClosestMatchingParent(node, context, isJSXExpressionContainerMatcher);

  // Check whether prop name indicates accepted patterns
  if (
    jsxExpressionContainer
    && jsxExpressionContainer.parent
    && jsxExpressionContainer.parent.type === 'JSXAttribute'
    && jsxExpressionContainer.parent.name
    && jsxExpressionContainer.parent.name.type === 'JSXIdentifier'
  ) {
    const propName = jsxExpressionContainer.parent.name.name;

    // Starts with render, e.g. <Component renderFooter={() => <div />} />
    if (propMatchesRenderPropPattern(propName, propNamePattern)) {
      return true;
    }

    // Uses children prop explicitly, e.g. <Component children={() => <div />} />
    if (propName === 'children') {
      return true;
    }
  }

  return false;
}
Check whether given node is declared inside a render prop
```jsx
<Component renderFooter={() => <div />} />
<Component>{() => <div />}</Component>
```
@param {ASTNode} node The AST node
@param {Context} context eslint context
@param {string} propNamePattern a pattern to match render props against
@returns {boolean} True if component is declared inside a render prop, false if not