Sha256: b5a96c5c7b171cd771ce4ca90bf5ed67f760cbde4a4456fb33515ae5794eac1a

Contents?: true

Size: 451 Bytes

Versions: 81

Compression:

Stored size: 451 Bytes

Contents

// Generates static `useLocation` hook. The hook always
// responds with initial path provided.
// You can use this for server-side rendering.
export default (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;
};

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
isomorfeus-preact-10.9.0 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.8.2 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.8.1 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.8.0 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.7.3 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.7.2 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.7.1 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.7.0 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.62 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.61 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.60 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.59 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.58 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.57 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.56 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.55 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.54 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.53 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.52 node_modules/wouter-preact/static-location.js
isomorfeus-preact-10.6.51 node_modules/wouter-preact/static-location.js