摘要: Here is a component which doesn't need to use useEffect export function LocalTodos() { const [todos, setTodos] = useState([]) useEffect(() => { const 阅读全文
posted @ 2024-04-08 14:54 Zhentiw 阅读(2) 评论(0) 推荐(0) 编辑
摘要: The component using useEffect which is not necessary: function TopicEditor({ selectedTopicId }) { const [enteredNote, setEnteredNote] = useState(''); 阅读全文
posted @ 2024-04-08 14:49 Zhentiw 阅读(1) 评论(0) 推荐(0) 编辑
摘要: struct VecMetadata { first_elem_index: usize, length: usize, capacity: usize } struct SliceMetadata { first_elem_index: usize, length: usize } Slice i 阅读全文
posted @ 2024-04-08 14:20 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑
摘要: The following code will have borrowing problem fn print_years(years: Vec<i32>) { for year in years.iter() { println!("Year: {}", year); } } // dealloc 阅读全文
posted @ 2024-04-08 01:24 Zhentiw 阅读(3) 评论(0) 推荐(0) 编辑