Sha256: 6367c30c834e9eceba2f25745926783f2c2c1ca1245c452178e9e1539c94825a
Contents?: true
Size: 506 Bytes
Versions: 81
Compression:
Stored size: 506 Bytes
Contents
'use strict'; // Generates static `useLocation` hook. The hook always // responds with initial path provided. // You can use this for server-side rendering. var staticLocation = (path = "/", { record = false } = {}) => { let hook; const navigate = (to, { replace } = {}) => { if (record) { if (replace) { hook.history.pop(); } hook.history.push(to); } }; hook = () => [path, navigate]; hook.history = [path]; return hook; }; module.exports = staticLocation;
Version data entries
81 entries across 81 versions & 1 rubygems