我正在尝试将我的参数与react-articles-js 库中的JSX 分开。我将参数放在一个对象中:
let options = {
"particles": {
"number": {
"value": 50
},
"size": {
"value": 3
}
},
"interactivity": {
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
}
}
}
}
然后我写我的 JSX:
<Particles params={options}/>
当我这样做时,我收到错误
The types of 'interactivity.events.onhover.mode' are incompatible between these types.
Type 'string' is not assignable to type '"repulse" | "grab" | "push" | "remove" | "bubble" | InteractivityMode[] | undefined'. TS2322
我无法导入 InteractivityMode 接口,因为它未在库中导出。我不知道在这里做什么。
慕森卡
相关分类