Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amji fixes #1827

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Amji fixes #1827

wants to merge 3 commits into from

Conversation

meetamjadsaeed
Copy link

@meetamjadsaeed meetamjadsaeed commented Dec 18, 2023

Before submitting a pull request, please complete the following checklist:

Checklist

  • The existing test suites (npm test) all pass
  • For any new features or bug fixes, both positive and negative test cases have been added
  • For any new features, documentation has been added
  • For any documentation changes, the text has been proofread and is clear to both experienced users and beginners.
  • Format your code with prettier (yarn run prettier).
  • Run the Flow typechecks (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


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)

image

Closing Note

Thank the maintainers and contributors for their time.

Thank you for reviewing this Pull Request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant