marwinburesch / marwinburesch/react-playground
Unnecessary `id` property of the `ToggleSwitch` component
@marwinburesch is already working on this.
Since Nov 20, 2019.
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Instead of using `id` and `htmlFor`, you could add the `input` as children of the `label`. I was a little bit confused by the `id` property of the `ToggleSwitch` component.
_Originally posted by @lmachens in https://github.com/marwinburesch/react-playground/pull/3_
> I sourced the `ToggleSwitch` from https://codesandbox.io/s/6v7n1vr8yn and I can't make `input` work correctly as a child of `label`. If I do it like you said functionality still works, obviously, however it won't change color and position. I am assuming this has to do with `&:checked + ${CheckBoxLabel}` in line 45, but I don't fully understand it yet. Will do research and fix it in another PR
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.
Assessment
This issue has not been assessed yet.