Reputation: 1342
I'm getting a flow error flow: property replace (Property not found in Array) when I'm calling replace on my array. How do I tell flow it is a mobx observable array? I already made the change to my flowconfig [libs] to include mobx
/* @flow */
import { observable } from 'mobx'
export default class GiphyStore {
@observable images = []
async getImageList() {
try {
// make axios network request
const imgs = response.data.data.map(item => {
return { id: item.id, url: item.images.downsized.url }
})
this.images.replace(imgs) // getting error???
} catch (e) {}
}
}
Upvotes: 1
Views: 977
Reputation: 2333
According to the test file provided by mobx you need to;
IObservableArray<>
type for your arraysIt was a joint effort of finding the answer, thanks a lot.
Upvotes: 1