Breaking at React router DOM
SatyaQworks opened this issue · comments
: navigator.block is not a function at use-blocker.ts:13:1
react-router-dom: v6.4.1
this will not work with react-router v6.4x because they removed the APIs necessary for this solution to work in v6.4.0. There is a pretty lengthy thread about this here.
that still works with
remix-run/react-router#8139 (comment)
and
import { FC } from "react";
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom";
import { history } from "history";
const App: FC = () => {
return (
<HistoryRouter history={history}>
<YOUR CODE HERE>
</HistoryRouter>
);
};
export default App;
I will check this issue this weekend
remix-run/react-router#8139 (comment)
Will wait for usePrompt and useBlocker to come back in the next release.
FYI: useBlocker
is now available in React Router 👏
@karol-majewski thanks for heads-up, will create an update.
Updated with react-router-prompt v0.5.0.
Note: This supports react router dom >=v6.7.0 and supports only data routers
Do reopen if you find any issue in the release