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

ForwardRef support - Flex and Grid #720

Merged
merged 3 commits into from
Nov 16, 2021
Merged

ForwardRef support - Flex and Grid #720

merged 3 commits into from
Nov 16, 2021

Conversation

reesscot
Copy link
Member

Issue:
Closes #710

Description of changes:
This PR adds forward ref support for Flex and Grid primitives by wrapping them in React.forwardRef. I'm limiting the number of primitives changed per PR to make them easier to review.

const CustomerComponent = () => {
  const ref = React.useRef(null);
  
  // do something with ref, like measure where it is on screen:
  // ref.current.getBoundingClientRect()
  
  return (
    <Flex ref={ref} />
  );
};

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@changeset-bot
Copy link

changeset-bot bot commented Nov 16, 2021

🦋 Changeset detected

Latest commit: c047f4d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@aws-amplify/ui-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@dbanksdesign dbanksdesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

you the real mvp

@reesscot reesscot enabled auto-merge (squash) November 16, 2021 05:31
@reesscot reesscot temporarily deployed to ci November 16, 2021 05:35 Inactive
@reesscot reesscot temporarily deployed to ci November 16, 2021 05:35 Inactive
@reesscot reesscot temporarily deployed to ci November 16, 2021 05:35 Inactive
@reesscot reesscot merged commit 84a86b4 into main Nov 16, 2021
@reesscot reesscot deleted the forward-ref-flexgrid branch November 16, 2021 05:56
@github-actions github-actions bot mentioned this pull request Nov 16, 2021
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.

Flex & Grid don't accept ref prop while View does
2 participants