I have added the onClick handler in source\List\List.js. With this change, users can add their own onclick handler to each item based on its index. I have also made it optional, so if the user has not added a handler, it will not throw any errors.
How To use
function MyComponent() {
const handleItemClick = (index) => {
console.log(`Clicked on item at index ${index}`);
// Additional click handling logic...
};
return (
<List
// ... (other props)
onClick={handleItemClick}
/>
);
}
Related Issue
This issue is related to #1734.
Screenshots (if applicable)
Closing Note
Thank the maintainers and contributors for their time.
Before submitting a pull request, please complete the following checklist:
Checklist
npm test
) all passyarn run prettier
).yarn run typecheck
).Description
Add onClick to every list item.
Changes Made
I have added the onClick handler in source\List\List.js. With this change, users can add their own onclick handler to each item based on its index. I have also made it optional, so if the user has not added a handler, it will not throw any errors.
How To use
Related Issue
This issue is related to #1734.
Screenshots (if applicable)
Closing Note
Thank the maintainers and contributors for their time.
Thank you for reviewing this Pull Request!