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

test: add react.fragment with key #750

Merged
merged 3 commits into from Jul 18, 2023

Conversation

jchavarri
Copy link
Collaborator

It seems there's been a recent regression that involves React.Fragment and key attribute. It was possible to use option(string) before while now the code does not type check.

test/React__test.re Outdated Show resolved Hide resolved
@anmonteiro anmonteiro force-pushed the test/add-react-fragment-w-key branch 3 times, most recently from 03ac1df to 2936262 Compare July 16, 2023 21:40
@jchavarri
Copy link
Collaborator Author

jchavarri commented Jul 18, 2023

Found some interesting change when testing this branch.

The following code would compile before without issues:

let resultRow = twitterAuthor =>
  <tr key={twitterAuthor.EndpointT.screen_name}>
    <td className="DetailsWhoTweeted-col--avatar">
      <div className=Css.avatarContainer>
        <CeAvatarIcon
          src={Some(String.replace(twitterAuthor.profile_image_url->Wrap.Url.show, "http://", "https://"))}
        />
      </div>
    </td>
  </tr>

With this branch (or maybe, after the changes in #714? not sure), it triggers this error:

File "CeDetailsWhoTweeted.re", line 154, characters 51-68:
154 |             src={Some(String.replace(twitterAuthor.profile_image_url->Wrap.Url.show, "http://", "https://"))}
                                                         ^^^^^^^^^^^^^^^^^
Error: Unbound record field profile_image_url

Edit: created #752 to discuss this separately.

@jchavarri
Copy link
Collaborator Author

@anmonteiro I updated the branch with latest main. On my side everything looks good, the issue reported above doesn't seem like a big deal.

Feel free to merge whenever you think is ready (I can't approve as the creator of the branch).

@anmonteiro anmonteiro force-pushed the test/add-react-fragment-w-key branch from 9127eee to 8c12ff8 Compare July 18, 2023 20:37
@anmonteiro anmonteiro merged commit 52aa51b into reasonml:main Jul 18, 2023
4 checks passed
@jchavarri jchavarri deleted the test/add-react-fragment-w-key branch July 19, 2023 07:16
davesnx added a commit to davesnx/opam-repository that referenced this pull request Sep 13, 2023
CHANGES:

* Migrate the reason-react PPX and library to the [new React JSX
transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
  (@anmonteiro in [reasonml/reason-react#714](reasonml/reason-react#714))
* Add `suppressHydrationWarning` to supported props (@davesnx in
[reasonml/reason-react#721](reasonml/reason-react#721))
* Rename `reactjs-jsx-ppx` to `reason-react-ppx` ([@davesnx in reasonml/reason-react#732](reasonml/reason-react#732))
* Fix locations for lower and uppercase components so that merlin / editor
  integration can get type defs on hover ([@jchavarri in reasonml/reason-react#748](reasonml/reason-react#748))
* Refine types for `key` attributes ([@anmonteiro in reasonml/reason-react#750](reasonml/reason-react#750))
* Bump React depext to v17-18 reasonml/reason-react#777 ([@jchavarri in reasonml/reason-react#777](https://github.com/reasonml/reason-react/pull/777/files))
* Make optional props optional properly
 ([@davesnx in reasonml/reason-react#776](reasonml/reason-react@0a98c07))
davesnx added a commit to davesnx/opam-repository that referenced this pull request Sep 13, 2023
CHANGES:

* Migrate the reason-react PPX and library to the [new React JSX
transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
  (@anmonteiro in [reasonml/reason-react#714](reasonml/reason-react#714))
* Add `suppressHydrationWarning` to supported props (@davesnx in
[reasonml/reason-react#721](reasonml/reason-react#721))
* Rename `reactjs-jsx-ppx` to `reason-react-ppx` ([@davesnx in reasonml/reason-react#732](reasonml/reason-react#732))
* Fix locations for lower and uppercase components so that merlin / editor
  integration can get type defs on hover ([@jchavarri in reasonml/reason-react#748](reasonml/reason-react#748))
* Refine types for `key` attributes ([@anmonteiro in reasonml/reason-react#750](reasonml/reason-react#750))
* Bump React depext to v17-18 reasonml/reason-react#777 ([@jchavarri in reasonml/reason-react#777](https://github.com/reasonml/reason-react/pull/777/files))
* Make optional props optional properly
 ([@davesnx in reasonml/reason-react#776](reasonml/reason-react@0a98c07))
davesnx added a commit to davesnx/opam-repository that referenced this pull request Sep 13, 2023
CHANGES:

* Migrate the reason-react PPX and library to the [new React JSX
transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
  (@anmonteiro in [reasonml/reason-react#714](reasonml/reason-react#714))
* Add `suppressHydrationWarning` to supported props (@davesnx in
[reasonml/reason-react#721](reasonml/reason-react#721))
* Rename `reactjs-jsx-ppx` to `reason-react-ppx` ([@davesnx in reasonml/reason-react#732](reasonml/reason-react#732))
* Fix locations for lower and uppercase components so that merlin / editor
  integration can get type defs on hover ([@jchavarri in reasonml/reason-react#748](reasonml/reason-react#748))
* Refine types for `key` attributes ([@anmonteiro in reasonml/reason-react#750](reasonml/reason-react#750))
* Bump React depext to v17-18 reasonml/reason-react#777 ([@jchavarri in reasonml/reason-react#777](https://github.com/reasonml/reason-react/pull/777/files))
* Make optional props optional properly
 ([@davesnx in reasonml/reason-react#776](reasonml/reason-react@0a98c07))
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

2 participants