2
0

refactor: ♻️ Migrate from short-uuid to cuid lib

This commit is contained in:
Baptiste Arnaud
2022-03-18 12:30:42 +01:00
parent 64bafd15a1
commit 1423c14547
47 changed files with 120 additions and 132 deletions

View File

@ -1,9 +1,9 @@
import { Box, Button, Fade, Flex, IconButton, Stack } from '@chakra-ui/react'
import { TrashIcon, PlusIcon } from 'assets/icons'
import cuid from 'cuid'
import { dequal } from 'dequal'
import { Draft } from 'immer'
import React, { useEffect, useState } from 'react'
import { generate } from 'short-uuid'
import { useImmer } from 'use-immer'
type ItemWithId<T> = T & { id: string }
@ -42,7 +42,7 @@ export const TableList = <T,>({
const createItem = () => {
setItems((items) => {
const id = generate()
const id = cuid()
const newItem = { id } as Draft<ItemWithId<T>>
items.push(newItem)
})