Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: speed improvement #398

Merged
merged 1 commit into from
Dec 4, 2024
Merged

fix: speed improvement #398

merged 1 commit into from
Dec 4, 2024

Conversation

michaelneale
Copy link
Collaborator

@alexhancock this stops it triggering a full chat re-calculation on every single keystroke, as there is no need. Can have input work out and manage its own state.

@@ -173,8 +179,6 @@ function ChatContent({

<Input
handleSubmit={handleSubmit}
handleInputChange={handleInputChange}
input={input}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're removing this, you likely don't need the handleChange at all in Input.tsx any more?

It's no longer "controlled input" https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Input needs it to accumulate the chars (if I get rid of it - won't work) IIUC?

@alexhancock alexhancock self-requested a review December 4, 2024 02:15
@michaelneale michaelneale merged commit f6b5f97 into v1.0 Dec 4, 2024
2 checks passed
michaelneale added a commit that referenced this pull request Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants