How to use the @reach/router.navigate function in @reach/router

To help you get started, we’ve selected a few @reach/router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github haiwen / seahub / frontend / src / settings.js View on Github external
onSearchedClick = (selectedItem) => {
    if (selectedItem.is_dir === true) {
      let url = siteRoot + 'library/' + selectedItem.repo_id + '/' + selectedItem.repo_name + selectedItem.path;
      navigate(url, {repalce: true});
    } else {
      let url = siteRoot + 'lib/' + selectedItem.repo_id + '/file' + Utils.encodePath(selectedItem.path);
      let newWindow = window.open('about:blank');
      newWindow.location.href = url;
    }
  }
github aws-samples / aws-sdk-js-v3-workshop / Exercise2 / frontend / src / content / SaveNoteButton.tsx View on Github external
const handleSave = async (event: any) => {
    event.preventDefault();
    setIsSaving(true);

    const { noteId, noteContent } = props;
    const updateNoteURL = `${config.GatewayURL}/notes/${noteId}`;

    try {
      await fetch(updateNoteURL, {
        method: "PUT",
        body: JSON.stringify({ content: noteContent })
      });
      navigate("/");
    } catch (error) {
      setErrorMsg(`${error.toString()} - ${updateNoteURL} - ${noteContent}`);
    } finally {
      setIsSaving(false);
    }
  };
github michaelwilcox / headfon.es / client / src / components / search / AlbumListing / index.tsx View on Github external
function navigateToAlbum() {
    const { id } = album;
    navigate(`/album/${id}`);
  }
  function handleAlbumPlay(e) {
github jxnblk / mdx-deck / packages / gatsby-theme / src / navigate.js View on Github external
const previousSlide = ({ slug, index, metadata, setState }) => {
  const n = index - 1
  if (n < 0) return
  navigate([slug, n].join('/'))
  const { steps = 0 } = metadata[n] || {}
  setState({ step: steps })
}
github react-hook-form / react-hook-form-website / src / components / ApiPage.tsx View on Github external
onClick={() => {
                navigate(translateLink("advanced-usage", currentLanguage))
              }}
              style={{ margin: "40px auto" }}
github US-CBP / GTAS / gtas-ui / src / pages / login / Login.js View on Github external
useEffect(() => {
        if (authenticate) {
            navigate(`/gtas/tools/about`, true);
        }
    }, [authenticate, failedLogin]);
github michaelwilcox / headfon.es / client / src / components / search / SearchInput / index.tsx View on Github external
function handleSearch() {
      navigate(`/search/results/${searchTerm}`);
  }
github haiwen / seahub / frontend / src / repo-history.js View on Github external
onSearchedClick = (selectedItem) => {
    if (selectedItem.is_dir === true) {
      let url = siteRoot + 'library/' + selectedItem.repo_id + '/' + selectedItem.repo_name + selectedItem.path;
      navigate(url, {repalce: true});
    } else {
      let url = siteRoot + 'lib/' + selectedItem.repo_id + '/file' + Utils.encodePath(selectedItem.path);
      let newWindow = window.open('about:blank');
      newWindow.location.href = url;
    }
  }