我希望一旦我在列表中添加另一个项目,前一个项目的颜色就不应更改
const NoteItem = ({ note }) => {
const { colors, randomColorFunction } = useContext(AppContext);
const color = randomColorFunction(colors);
return (
{note.title}
{note.content}
{note.date}
);
}; Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号