How to use the @reach/router.useParams 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 seashell / drago / ui / src / views / interfaces / details / index.js View on Github external
const InterfaceDetailsView = () => {
  const navigate = useNavigate()
  const location = useLocation()
  const urlParams = useParams()

  const { hostId } = location.state || {}

  if (hostId === undefined) {
    navigate(`/ui/hosts`)
  }

  const formik = useFormik({
    initialValues: {
      name: null,
      networkId: null,
      ipAddress: null,
      listenPort: null,
    },
    validationSchema: Yup.object().shape({
      name: Yup.string()
github seashell / drago / ui / src / views / links / details / index.js View on Github external
const LinkDetailsView = () => {
  const navigate = useNavigate()
  const location = useLocation()
  const urlParams = useParams()

  const { hostId } = location.state || {}

  const formik = useFormik({
    initialValues: {
      fromInterfaceId: null,
      toInterfaceId: null,
      allowedIps: [],
      persistentKeepalive: null,
    },
    validationSchema: Yup.object().shape({
      fromInterfaceId: Yup.string()
        .required()
        .nullable(),
      toInterfaceId: Yup.string()
        .required()
github seashell / drago / ui / src / views / hosts / details / attributes-tab / index.js View on Github external
const HostAttributesTab = () => {
  const navigate = useNavigate()
  const location = useLocation()
  const urlParams = useParams()

  const formik = useFormik({
    initialValues: {
      name: null,
      labels: [],
      advertiseAddress: null,
    },
    validationSchema: Yup.object().shape({
      name: Yup.string()
        .required()
        .nullable(),
      advertiseAddress: Yup.string().nullable(),
    }),
  })

  const getHostQuery = useQuery(GET_HOST, {