1. const handleListChildren = (
id: number,
params: (string | undefined | number)[]
) 를
type testType = {
params : (string | undefined | number)[]
}
const handleListChildren = (
id: number,
params: testType
)
로 바꾼다고 하면 여기에서 어디가 오류난걸까요?
2.
history.push를 이용하여 위의 params 타입의 배열값을 넘겼습니다
배열의 타입은 string number undefined의 [ ] 이구요....
이것들을 location.state로 받아왔는데
location.state의 type이 unknown인 것 같다고 뜨네요
const data :unknown = location.state라고 밑에서 값을 사용하려고 하면 오류가 납니다...
{data[0]} <라고하면 빨간밑줄 뜨면서 '개체가 알 수 없는 형식입니다'라고 나옵니다 ㅠㅠ..
2가지 알려주시면 감사하겠습니다 ㅠㅠ