I've been working on implementing an axios getPosts function, but I keep encountering a syntax error that I can't seem to locate in my code.
getPosts = async () => {
let data = await api.get('/').then(({ data })
=> data);
this.setState({ posts: data })
}
Below is the posted error message:
./src/App.js
SyntaxError: /home/roxx/Documents/eternal_kings_web_app/Twitter-Clone/src/App.js: Unexpected token, expected ",", (25:4)
23 | getPosts = async () => {
24 | let data = await api.get('/').then(({ data })
> 25 | => data);
| ^
26 | this.setState({ posts: data })
27 | }