Skip to content

Instantly share code, notes, and snippets.

View alexmkio's full-sized avatar
:octocat:

Alex Kio alexmkio

:octocat:
View GitHub Profile

React Router Prework

This gist contains a short assignment I'd like everyone to complete before our formal lesson. The prework involves reading some of the React Router documentation, and will allow us to keep the lesson more hands on.

Instructions

  1. Fork this gist
  2. On your own copy, go through the listed readings and answer associated questions

You will not be turning this in; it's for your own understanding/learning/benefit 😁

import { useCallback, useId, useMemo } from 'react';
import Checkbox from '@components/Checkbox';
export type CheckboxOption = { value: string; label: string };
type CheckboxesProps = {
name: string;
options: CheckboxOption[];
values: string[];
import * as RadixCheckbox from '@radix-ui/react-checkbox';
import { useId } from 'react';
import CheckmarkIcon from '@components/icons/Checkmark';
import styles from './Checkbox.module.scss';
type CheckboxProps = {
label?: string;
id?: string;
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { AddClientNoteRequestModel } from '@generated/api/models/AddClientNoteRequestModel';
import { ClientNoteResponseModelPaginatedList } from '@generated/api/models/ClientNoteResponseModelPaginatedList';
import { api } from '@utils/axios';
export const useCreateNote = (clientId: string) => {
const queryClient = useQueryClient();
return useMutation(
import { useMemo, useState } from 'react';
import { UserFormState } from '@components/settings/account-management/UserCard';
import { ApiError } from '@generated/api/core/ApiError';
import { AddClientNoteRequestModel } from '@generated/api/models/AddClientNoteRequestModel';
import { useCreateNote } from './mutation/useCreateNote';
export type TypeAddNote = {
import { NextApiRequest, NextApiResponse } from 'next';
import { AddClientNoteRequestModel } from '@generated/api/models/AddClientNoteRequestModel';
import { ClientNoteSortOption } from '@generated/api/models/ClientNoteSortOption';
import { SortDirection } from '@generated/api/models/SortDirection';
import { appClient } from '@lib/api/appClient';
import { withMethodRestriction } from '@lib/api/utils/withMethodRestriction';
import { HTTP_METHODS } from '@lib/constants';