Answer the question
In order to leave comments, you need to log in
How to change type to any?
The whole point is that the code is supposed to work, but when run it gives the following error:
'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation. TS7057
function* fetchTweetsRequest(){
try {
const items = yield call(TweetsApi.fetchTweets);
yield put(setTweets(items));
} catch (error) {
yield put(setLoadingState(LoadingState.ERROR));
}
}
export const TweetsApi = {
fetchTweets(): Promise<TweetsState['items']> {
return axios.get('https://trycode.pw/c/GYSNI.json').then(({ data }) => data)
},
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question