salesforce / design-system-react

Salesforce Lightning Design System for React
https://design-system-react-site.herokuapp.com/
BSD 3-Clause "New" or "Revised" License
915 stars 416 forks source link

ColorPicker component has typescript errors for the methods in the event props #3020

Open bolivierjr opened 2 years ago

bolivierjr commented 2 years ago

Our team uses SLDS react components in a typescript environment and we are seeing a few typescript errors on certain props in the ColorPicker component that uses event handlers. Issues are happening in the event props for the following event handlers: onChange, onClose, onOpen, onRequestClose, onWorkingColorChange. This is due to the types for those props only take in one parameter, e.g. onChange?: (v: any) => any; instead of having an additional event parameter for the handler. We recently fixed some other components in a seperate Issue/PR that was merged, here. This makes our linting tools fail in our CI/CD. Here are some snapshots of the error.

Screen Shot 2022-03-10 at 10 51 15 AM Screen Shot 2022-03-10 at 10 51 58 AM

bolivierjr commented 2 years ago

looks like there is already an issue and PR open for this #3008, with more explicit types, that might be the better choice.