history#createHashHistory TypeScript Examples
The following examples show how to use
history#createHashHistory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NewTunnelButton.tsx From wiregui with MIT License | 6 votes |
export default function NewTunnelButton() {
const history = createHashHistory();
function handleRedirect() {
history.push("/new-tunnel");
}
return (
<Button size="xs" w="100%" leftIcon={<FaPlus />} onClick={handleRedirect}>
<Text fontSize="sm">New Tunnel</Text>
</Button>
);
}
Example #2
Source File: history-provider.ts From malagu with MIT License | 6 votes |
constructor(
@Value('malagu.react.history') protected readonly historyOptions: any
) {
const historyCreatorMap: { [key: string]: any } = {
hash: createHashHistory,
browser: createBrowserHistory,
memory: createMemoryHistory
};
if (this.historyOptions) {
const { type, ...options } = historyOptions;
const create = historyCreatorMap[type] || createHashHistory;
this.history = create(options);
} else {
this.history = createHashHistory();
}
}
Example #3
Source File: GetStarted.spec.tsx From che-dashboard-next with Eclipse Public License 2.0 | 6 votes |
describe('Get Started page', () => {
let masthead: HTMLElement;
beforeEach(() => {
const store = createFakeStore();
const history = createHashHistory();
render(
<Provider store={store}>
<GetStarted history={history} />
</Provider>
);
masthead = screen.getByRole('heading');
});
it('should have correct masthead when Get Started tab is active', () => {
const getStartedTabButton = screen.getByRole('button', { name: 'Get Started' });
getStartedTabButton.click();
expect(masthead.textContent?.startsWith('Getting Started with'));
});
it('should have correct masthead when Custom Workspace tab is active', () => {
const customWorkspaceTabButton = screen.getByRole('button', { name: 'Custom Workspace' });
customWorkspaceTabButton.click();
expect(masthead.textContent?.startsWith('Create Custom Workspace'));
});
});
Example #4
Source File: utils.ts From MagicUI with Apache License 2.0 | 6 votes |
history = createHashHistory()
Example #5
Source File: App.tsx From msteams-meetings-template with MIT License | 5 votes |
hist = createHashHistory()
Example #6
Source File: store.tsx From rewind with MIT License | 5 votes |
history = createHashHistory({})
Example #7
Source File: index.tsx From che-dashboard-next with Eclipse Public License 2.0 | 5 votes |
history = createHashHistory()
Example #8
Source File: index.ts From multisig-react with MIT License | 5 votes |
history = createHashHistory()
Example #9
Source File: index.ts From idena-pocket with MIT License | 5 votes |
history = createHashHistory()
Example #10
Source File: URLParser.test.ts From kfp-tekton-backend with Apache License 2.0 | 5 votes |
history = createHashHistory()
Example #11
Source File: index.tsx From mysterium-vpn-desktop with MIT License | 5 votes |
history = createHashHistory()
Example #12
Source File: store.ts From deskreen with GNU Affero General Public License v3.0 | 5 votes |
history = createHashHistory()
Example #13
Source File: constants.ts From MagicUI with Apache License 2.0 | 5 votes |
history = createHashHistory()
Example #14
Source File: index.tsx From electron with MIT License | 5 votes |
history = syncHistoryWithStore(createHashHistory({ basename: Config.publicPath }), new RouterStore())