docs: function Prompt({ message, when = true }) {
    return (
      <RouterContext.Consumer>
        {context => {
          invariant(context, "You should not use <Prompt> outside a <Router>");
  
          if (!when || context.staticContext) return null;
  
          const method = context.history.block;
  
          return (
            <Lifecycle
              onMount={self => {
                self.release = method(message);
              }}
              onUpdate={(self, prevProps) => {
                if (prevProps.message !== message) {
                  self.release();
                  self.release = method(message);
                }
              }}
              onUnmount={self => {
                self.release();
              }}
              message={message}
            />
          );
        }}
      </RouterContext.Consumer>
    );
  }