gpt4 book ai didi

javascript - '解构(缺少注释 )' source: ' 流'

转载 作者:行者123 更新时间:2023-12-03 03:26:53 25 4
gpt4 key购买 nike

在 ES6 中解构时,我收到以下错误。我想知道防止此错误的正确流程注释是什么。

message: 'destructuring (Missing annotation)' source: 'flow'

import React from 'react'
import { Provider } from 'react-redux'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import Forecast from './Forecast'
import Map from './Map'

const Root = ({ store }) => ( //<<<< ERROR HERE
<Provider store={store}>
<Router>
<Switch>
<Route exact path='/' component={Forecast} />
<Route exact path='/map' component={Map} />
</Switch>
</Router>
</Provider>
)
export default Root

import { createStore, applyMiddleware } from 'redux'
import thunkMiddleware from 'redux-thunk'
import promiseMiddleware from 'redux-promise-middleware'
import reducers from './reducers'

const store = createStore(reducers, applyMiddleware(
thunkMiddleware,
promiseMiddleware()
))

export default store

最佳答案

您需要声明storetype

x:

const Root = ({ store } : {store : StoreType}) => {}

关于javascript - '解构(缺少注释 )' source: ' 流',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46283167/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com