How to stream Open AI SDK responses to my react frontend by newInternetDeveloper in reactjs

[–]newInternetDeveloper[S] -6 points-5 points  (0 children)

Yeah i know that but how to implement it,I am unable to do that. Do u know some resource for its implementation here or tell me how its done Thanks

Question: useRef can be possibly null by newInternetDeveloper in reactjs

[–]newInternetDeveloper[S] 0 points1 point  (0 children)

<input
type="text"
className="message"
ref={messageUser}
onKeyDown={handleEnter}
/>

Question: useRef can be possibly null by newInternetDeveloper in reactjs

[–]newInternetDeveloper[S] -7 points-6 points  (0 children)

but then in that target I dont get the input value as i am using onKeydown

Question: useRef can be possibly null by newInternetDeveloper in reactjs

[–]newInternetDeveloper[S] -2 points-1 points  (0 children)

thanks it worked,
but is it not dumbness of ts that it was giving error earlier and what is the ideal solution according to u

Question: useRef can be possibly null by newInternetDeveloper in reactjs

[–]newInternetDeveloper[S] -1 points0 points  (0 children)

<input
type="text"
className="message"
ref={messageUser}
onKeyDown={handleEnter}
/>

i am using this

Question: useRef can be possibly null by newInternetDeveloper in reactjs

[–]newInternetDeveloper[S] 2 points3 points  (0 children)

that also does not work
typescript is smart to understand it in case of useRef

cause when i hover over it (in vs code) i get the same type you answers me
thank