[From the Profiler docs](https://reactjs.org/docs/profiler.html#onrender-callback):

> The Profiler requires an onRender function as a prop. React calls this function any time a component within the profiled tree “commits” an update.

However, given:

```jsx
import React from 'react'
import ReactDOM from 'react-dom'

function Counter() {
  const [count, setCount] = React.useState(0)
  const increment = () => setCount(c => c + 1)
  return <button onClick={increment}>{count}</button>
}

function App() {
  return (
    <div>
      <React.Profiler
        id="counter"
        onRender={() => console.log('called')}
      >
        <div>
          Profiled counter
          <Counter />
        </div>
      </React.Profiler>
      <div>
        Unprofiled counter
        <Counter />
      </div>
    </div>
  )
}

ReactDOM.render(<App />, document.getElementById('root'))
```

I'm getting a log when I click on the unprofiled counter.

Reproduction: https://codesandbox.io/s/react-codesandbox-tnff6

Am I misunderstanding this API, or is this a bug?
DEV mode, we create a separate object for Context.Consumer that acts
   like a proxy to Context. This proxy object adds unnecessary code in PROD
   so we use the old behaviour (Context.Consumer references Context) to
   reduce size and overhead. The separate object references context via
   a property called "_context", which also gives us the ability to check
   in DEV mode if this property exists or not and warn if it does not.
  if (__DEV__) {
    if ((context: any)._context === undefined) {
       
       
       
      if (context !== context.Consumer) {
        if (!hasWarnedAboutUsingContextAsConsumer) {
          hasWarnedAboutUsingContextAsConsumer = true;
          warning(
            false,
            'Rendering <Context> directly is not supported and will be removed in ' +
              'a future major release. Did you mean to render <Context.Consumer> instead?',
          );
        }
      }
    } else {
      context = (context: any)._context;
    }
  }
  const newProps = workInProgress.pendingProps;
  const render = newProps.children;
  if (__DEV__) {
    warningWithoutStack(
      typeof render === 'function',