有没有办法在BrowserRouter.getUserConfirmation中使用自定义钩子?

时间:2020-10-01 03:43:39

标签: reactjs react-hooks react-router-dom

我无法完成这项工作。这有可能吗?

浏览器路由代码:

<Router
            history={history}
            getUserConfirmation={(message, callback) =>
              confirmationDialog(message, callback)
            }
          >

钩子是=>

export default function confirmationDialog(message, callback) {
  return(...)
}

我发现的所有示例(我也能够复制其中的一些示例)都使用ReactDOM.render而不是“ return”。

0 个答案:

没有答案
相关问题