REACT 3, Fetch() API, OpenAI API translation, useState() objects and conditional rendering, useContext() Providers and useCallback()
//We can add an init argument to the fetch(url, init) method
let init= {
method: 'POST', //GET, POST, PUT, DELETE, etc
body: JSON.stringify({
q: "Detectando el lenguaje" //body data type must match "Content-Type" header
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
},
}


Render useState() arrays and objects


Conditional rendering using components props

UseContext() and Provider components


UseCallback() React hook with useMemo()
Last updated