我正在使用 NativeBase 中的 Picker 和 DeckSwiper,当我从 Picker 菜单中选择不同的主题时,它会更新 DeckSwiper 组件上的 dataSource 读取的状态,该状态应该重新渲染以显示新内容。目前仅在刷第一张卡时才会重新渲染。状态改变后如何重新渲染? 这是一个 GIF,展示了它当前的工作原理。
这是代码
const Item = Picker.Item;
const topics = [
{ label: "topic 1", value: "1" },
{ label: "topic 2", value: "2" },
{ label: "topic 3", value: "3" }
];
const cards = [
{ text: "Card A", topicId: "1", name: "One" },
{ text: "Card B", topicId: "2", name: "Two" },
{ text: "Card C", topicId: "3", name: "Three" },
{ text: "Card …
Run Code Online (Sandbox Code Playgroud)