Problem
The input fields in the Quick Quote section of the TradeForm component lose focus after typing a single character.
This typically occurs when the Input component is being re-created on every render, causing React to treat it as a new component instance every time state updates.
Points: 50
Steps to Reproduce
- Open the Quick Quote section inside
TradeForm.
- Click on any input field (e.g., symbol, quantity, or price).
- Type one character.
- The input immediately loses focus.
- Notice:
- The input cursor jumps out.
- The component re-renders and replaces the input element with a new instance.
Expected Behavior
The input field should maintain focus while typing continuously.
To ensure this:
- Avoid defining the
Input component inline inside the TradeForm render function.
- Move the Input component definition outside the parent render, or
- Wrap it in
React.memo() so it maintains a stable identity across renders.
This ensures React does not unmount/remount the component on every keystroke.
Submission Guidelines
- Comment on this issue with your proposed solution approach.
- Wait for issue assignment from reviewers.
- Create a PR with clear, descriptive commit messages.
- Reference this issue in your PR description.
Problem
The input fields in the Quick Quote section of the
TradeFormcomponent lose focus after typing a single character.This typically occurs when the
Inputcomponent is being re-created on every render, causing React to treat it as a new component instance every time state updates.Points: 50
Steps to Reproduce
TradeForm.Expected Behavior
The input field should maintain focus while typing continuously.
To ensure this:
Inputcomponent inline inside theTradeFormrender function.React.memo()so it maintains a stable identity across renders.This ensures React does not unmount/remount the component on every keystroke.
Submission Guidelines