Skip to content

Commit e91af71

Browse files
klaemotimdorr
authored andcommitted
add note about possible use case for memoryHistory (#3693)
While developing a widget which is meant to be embedded into websites via an iframe, we noticed `history` taking over the parent page’s back/forward button (not a bug, just the way browser history works). We were able to isolate the routing to the widget by using `memoryHistory`. This PR just adds a tiny note that `createMemoryHistory` can be useful for a case like that.
1 parent d782f5c commit e91af71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ For more details, please see the [histories guide](/docs/guides/Histories.md).
622622

623623

624624
### `createMemoryHistory(options)`
625-
`createMemoryHistory` creates an in-memory `history` object that does not interact with the browser URL. This is useful when you need to customize the `history` used for server-side rendering, as well as for automated testing.
625+
`createMemoryHistory` creates an in-memory `history` object that does not interact with the browser URL. This is useful when you need to customize the `history` used for server-side rendering, as well as for automated testing or cases where you cannot/should not manipulate the browser history (for example when your application gets embedded in an iframe).
626626

627627

628628
### `useRouterHistory(createHistory)`

0 commit comments

Comments
 (0)