Skip to content

Conversation

@davesnx
Copy link
Member

@davesnx davesnx commented Nov 20, 2024

Depends on #859, that depends on #846

Allows to have a prop with ~ref


This PR also adds the cleanup function on ref as a new constructor: added another "constructor" instead of changing the current callbackRef to avoid a breaking change, we might add deprecations and further cleanup in the future versions to keep those constructors to the minimum

Comment on lines +26 to +27
let button = getByRole("FancyButton", container);
expect(button->innerHTML)->toBe("Click me");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we test here something about the ref? This test just shows that Button_with_ref is rendering ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, added another assertion but didn't want to go to clicks and other events to keep the test simple and fast

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks. (I think the expect in line 27 can be removed, because it doesn't test anything related to the ref)

@anmonteiro
Copy link
Member

…esting-libraries

* '19' of github.com:/reasonml/reason-react:
  Add deprecations on ReactDOMTestUtils
  Add uri comment back on action
  Update src/React.re
  Update src/React.re
  Update src/React.re
  Snapshot with lower {}
…on-react into replace-testing-libraries

* 'replace-testing-libraries' of github.com:/reasonml/reason-react:
  Bind React.act and React.actAsync
…on-react into ref-as-valid-prop

* 'replace-testing-libraries' of github.com:/reasonml/reason-react:
  Bind React.act and React.actAsync
  Bind React.act and React.actAsync
  Add deprecations on ReactDOMTestUtils
  Add uri comment back on action
  Add comment on install --force
  Remove jest from demo/dune
  Update src/React.re
  Update src/React.re
  Update src/React.re
  Snapshot with lower {}
Base automatically changed from replace-testing-libraries to 19 November 25, 2024 17:36
…lid-prop

* '19' of github.com:/reasonml/reason-react:
  Replace react dom's testing library with ReactTestingLibrary (#859)
@davesnx davesnx merged commit 08f5e19 into 19 Nov 25, 2024
3 checks passed
@davesnx davesnx deleted the ref-as-valid-prop branch November 25, 2024 18:01
davesnx added a commit that referenced this pull request Nov 25, 2024
…ises-as-annotations

* '19' of github.com:/reasonml/reason-react:
  Enable ref as valid prop (#862)
  Replace react dom's testing library with ReactTestingLibrary (#859)
  Add deprecations on ReactDOMTestUtils
  Add uri comment back on action
  Update src/React.re
  Update src/React.re
  Update src/React.re
  Snapshot with lower {}
@davesnx davesnx mentioned this pull request Nov 25, 2024
davesnx added a commit that referenced this pull request Nov 25, 2024
* '19' of github.com:/reasonml/reason-react:
  Enable ref as valid prop (#862)
  Replace react dom's testing library with ReactTestingLibrary (#859)
davesnx added a commit that referenced this pull request Apr 3, 2025
* Add useTransition with async support

* Add useTransitionAsync into the interface

* Add useOptimistic

* Rename use to usePromise and add useContext

* Move useTransitionAsync to Experimental

* Add formStatus to interface

* Leftover from removing useTransitionAsync to Experimental

* Add action_ and action_Async in ReactDOM props

* Fix reference to function on formStatus

* Embed FormData for now

* Add test of Form with useOptimistic

* Embed FormData into ReactDOM

* Move formStatus into ReactDOM

* Run formatter

* Bind React.useActionState instead of ReactDOM.useFormState

* Remove React.use being 'a => 'b

* Revert change on ReactDOM's prop 'action'

* useAction state published in React.rei

* Remove React.use being 'a => 'b

* Use act from 'react' inseat of react-dom/test-utils

* Snapshot with lower {}

* Update src/React.re

Co-authored-by: Javier Chávarri <[email protected]>

* Update src/React.re

Co-authored-by: Javier Chávarri <[email protected]>

* Update src/React.re

Co-authored-by: Javier Chávarri <[email protected]>

* Add uri comment back on action

* Add deprecations on ReactDOMTestUtils

* Replace react dom's testing library with ReactTestingLibrary (#859)

* Install melange-testing-library

* Install melange-testing-library npm deps

* Vendor melange-testing-library

* Fix Form__test with RTL

* Start migrating Hooks__test

* Remove dependency

* Remove unused code from Form__test

* Add a jest-devtoolsgs

* Add a jest-devtools

* Migrate Hooks and Form into RTL

* Add demo to manually test easily

* Use Uncurried for tests

* Migrate all React__test

* Force install since we are dealing with R19

* Snapshot with lower {}

* Remove jest from demo/dune

* Add comment on install --force

* Bind React.act and React.actAsync

* Bind React.act and React.actAsync

* Use React.act as async version only

* Test react.act and react.actasync

* Fix hola test :(

* Enable ref as valid prop (#862)

* Install melange-testing-library

* Install melange-testing-library npm deps

* Vendor melange-testing-library

* Fix Form__test with RTL

* Start migrating Hooks__test

* Remove dependency

* Remove unused code from Form__test

* Add a jest-devtoolsgs

* Add a jest-devtools

* Migrate Hooks and Form into RTL

* Add demo to manually test easily

* Use Uncurried for tests

* Migrate all React__test

* Force install since we are dealing with R19

* Snapshot with lower {}

* Enable ref in ppx

* Add jest test for ref

* Remove jest from demo/dune

* Add comment on install --force

* Improve test from checking ref

* Bind React.act and React.actAsync

* Bind React.act and React.actAsync

* Migrate custom childrens test to RTL

* Fix role for React__test

* Rollback change on _ppx

* Install latest react version with the useState fix

* Use [email protected]

---------

Co-authored-by: Javier Chávarri <[email protected]>
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.

4 participants