| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
PatternFly-React preview: https://patternfly-react-pr-2311.surge.sh |
Sorry, something went wrong.
| isDisabled?: boolean, | ||
| /** A callback for when the Switch selection changes. (isChecked, event) => {} */ | ||
| onChange: PropTypes.func, | ||
| onChange?(checked: boolean, event: FormEvent<HTMLInputElement>): void; |
There was a problem hiding this comment.
Use an arrow function so the docs pick this up properly. Like `onChange?: (checked: boolean, event: FormEvent) => void;
Sorry, something went wrong.
| 'aria-label': '' | ||
| }; | ||
| export class Switch extends React.Component<SwitchProps> { | ||
| id = ''; |
There was a problem hiding this comment.
Remove this class attribute
Sorry, something went wrong.
There was a problem hiding this comment.
Not sure what the purpose of this id is ... is it suppose to be the same as props.id?
Sorry, something went wrong.
There was a problem hiding this comment.
it instantiates the id when it is generated. And there is no id prop set.
Sorry, something went wrong.
There was a problem hiding this comment.
Shouldn't it instantiate it as a defaultProp to getUniqueId()?
Sorry, something went wrong.
There was a problem hiding this comment.
I am not sure. Does it work differently in TS than JS. In JS if you set defaultProp to getUniqueId, if you had more hat one Switch on the page the id's would all be the same? That is why we had it in the constructor before.
Sorry, something went wrong.
There was a problem hiding this comment.
Looks like it will set it for all of the name to be the same based off the time. Leave it in the constructor.
Sorry, something went wrong.
There was a problem hiding this comment.
Wondering what was the use case for that separate class attribute ID.
Sorry, something went wrong.
| 'aria-label': '' | ||
| }; | ||
| export class Switch extends React.Component<SwitchProps> { | ||
| id = ''; |
There was a problem hiding this comment.
Not sure what the purpose of this id is ... is it suppose to be the same as props.id?
Sorry, something went wrong.
| 'aria-label': '' | ||
| }; | ||
| export class Switch extends React.Component<SwitchProps> { | ||
| id = ''; |
There was a problem hiding this comment.
Looks like it will set it for all of the name to be the same based off the time. Leave it in the constructor.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
#2019
What:
Additional issues: