<!--
  Note: if the issue is about documentation or the website, please file it at:
  https://github.com/reactjs/reactjs.org/issues/new
-->

**Do you want to request a *feature* or report a *bug*?**

Bug.

**What is the current behavior?**

`React.useCallback` returns `undefined` when the component is rendered server-side.

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:**

This bug can be reproduced by creating a React component using a `useCallback`. Logging the return value on the server yields `undefined` while it properly returns the function in the browser.

You can observe this bug in this CodeSandbox: https://codesandbox.io/s/r557kww6wn The application is properly rendered to a string bug looking at the console, you will see that the return value of `useCallback` is `undefined`.

Here's the exact same application but rendered on the client: https://codesandbox.io/s/xvwv797pxz The function is properly logged to the console.

**What is the expected behavior?**

`React.useCallback` should return the memoized callback, not `undefined`.

**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**

* react: 16.7.0-alpha.2
* react-dom: 16.7.0-alpha.2
function useMutationEffect(
  create: () => mixed,
  inputs: Array<mixed> | void | null,
) {
  warning(
    false,
    'useMutationEffect does nothing on the server, because its effect cannot ' +
      "be encoded into the server renderer's output format. This will lead " +
      'to a mismatch between the initial, non-hydrated UI and the intended ' +
      'UI. To avoid this, useMutationEffect should only be used in ' +
      'components that render exclusively on the client.',
  );
}
export function useLayoutEffect(
  create: () => mixed,
  inputs: Array<mixed> | void | null,
) {
  warning(
    false,
    'useLayoutEffect does nothing on the server, because its effect cannot ' +
      "be encoded into the server renderer's output format. This will lead " +
      'to a mismatch between the initial, non-hydrated UI and the intended ' +
      'UI. To avoid this, useLayoutEffect should only be used in ' +
      'components that render exclusively on the client.',
  );
}
function dispatchAction<A>(
  componentIdentity: Object,
  queue: UpdateQueue<A>,
  action: A,