Im not good with {} i guess, but adding {} to my code as the code editor told me to but im still having problems can someone plz help?(i have the error at the last part } of the code)
function App() {
const [inputField, setInputField]= useState('')
const [userInput, setUserInput] = useState('')
const [savedInput, setSavedInput] = useState('')
const [edits, setEdits] = useState([])
const [charsLeft, setCharsLeft]= useState(50000)
const [newEditState, setNewEditState]= useState('')
const [wrongWord, setWrongWord] = useState('')
useEffect(()=>{
checkMyGrammar()
},[])
//axios call
checkMyGrammar = () => {
axios ({
method: 'GET',
url: 'https://proxy.hackeryou.com',
dataResponse: 'JSON',
paramsSerializer: function(params) {
return Qs.stringify(params, {arrayFormat: 'brackets'})
},
params: {
reqUrl: 'http://api.grammarbot.io/v2/check',
params: {
queryParam: userInput,
key: '#',
format: 'JSON',
text: userInput,
language: 'en-US',
},
proxyHeaders: {
'header_params': 'value',
},
xmlToJSON: false,
}
})
.then((results) => {
setEdits(results.data.matches)
setWrongWord(results.data.matches.map((misspelling) => {
return userInput.slice(misspelling.context.offset, misspelling.context.offset + misspelling.context.length)
})
})