piral-core
Version:
The core library for creating a Piral instance.
11 lines • 396 B
JavaScript
import { useGlobalStateContext, useSetter } from '../hooks';
/**
* The component capable of setting a global route at mounting.
*/
export function SetRoute({ path, component, }) {
const { setRoute } = useGlobalStateContext();
useSetter(() => component && setRoute(path, component));
// tslint:disable-next-line:no-null-keyword
return null;
}
//# sourceMappingURL=SetRoute.js.map