Closed easonoob closed 5 months ago
Hi @easonoob. I'm not 100% sure what you mean by the comment or what the question is, could you perhaps elaborate on the issue.
If you are referring to the fact that React re-renders the component when you use useState
, I have discussed this topic in the following issue.
Let me know if you need further help. Thanks!
yes react re-renders , I'm following #61
I'm going to close this issue as the conversation on this topic should be continued in the following issue. Thanks!
When the ColorChanger button is clicked to change the color, it triggers a re-render of the DeepChatReact component. This re-render, in turn, causes the Chat component to also be re-rendered, resulting in the loss of its internal state, such as any unfinished text in the input box. However, if the DeepChatReact component is used without passing props, like , the unfinished text in the input box is preserved. This behavior suggests that the re-rendering of DeepChatReact due to prop changes is impacting the state of Chat.