react-component / react-component/select
使用 optionLabelProp 自定义选中项, 无法通过外部依赖项更新选中项属性
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 938
- Forks
- 482
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 2
Description
场景:
自定义 Select 选中项后, 需要支持 dark mode 主题, Select 选中项文字样式跟随主题切换
问题:
外部感知到 dark mode 更新后, 尝试更新 Select 已 选中项 文字颜色, 结果更新失败
https://github.com/react-component/select/assets/26668179/8959036b-c68c-46e2-8394-c9e5fd216e0e
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in the linked CodeSandbox, using /src/App.tsx around line 86 and the Select configured with optionLabelProp. Trace how an external dark-mode update reaches the selected label. Done means the selected item's text color updates when the theme changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100