我得到了这个代码:
const [ candyMachine, setCandyMachine ] = ref<CandyMachineAccount>()
// ^^^^^^^^^ Error Here ^^^^^^^^^
我收到了这个错误:
Type 'Ref<CandyMachineAccount | undefined>' must have a '[Symbol.iterator]()' method that returns an iterator.
这是CandyMachineAccount
export interface CandyMachineAccount {
id: anchor.web3.PublicKey;
program: anchor.Program;
state: CandyMachineState;
}
我的代码基于这个 React repo:Fair-launch
那里是这样写的:
const [candyMachine, setCandyMachine] = useState<CandyMachineAccount>();
我认为问题是我编写了无效的 Vue 语法?(我使用 Vue3/Composition API)