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

Implement missing React 18 hooks, useCallback accepts non-unit afunctions #1104

Merged
merged 5 commits into from
Dec 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix scaladoc
rpiaggio committed Dec 27, 2024

Verified

This commit was signed with the committer’s verified signature.
mifi Mikael Finstad
commit b99f36160035f1b39378731c43c953088d86cd36
Original file line number Diff line number Diff line change
@@ -196,8 +196,7 @@ object Api {
*
* By default, effects run after every completed render.
* If you'd only like to execute the effect when your component is mounted, then use [[useEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* a first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useEffectWithDeps]].
*
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
@@ -209,8 +208,7 @@ object Api {
*
* By default, effects run after every completed render.
* If you'd only like to execute the effect when your component is mounted, then use [[useEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* a first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useEffectWithDeps]].
*
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
@@ -240,7 +238,7 @@ object Api {
/** The callback passed to useEffect will run after the render is committed to the screen. Think of effects as an
* escape hatch from React’s purely functional world into the imperative world.
*
* This will only execute the effect when values in a first argument, change.
* This will only execute the effect when values in the first argument change.
*
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
@@ -250,7 +248,7 @@ object Api {
/** The callback passed to useEffect will run after the render is committed to the screen. Think of effects as an
* escape hatch from React’s purely functional world into the imperative world.
*
* This will only execute the effect when values in a first argument, change.
* This will only execute the effect when values in the first argument change.
*
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
@@ -268,8 +266,7 @@ object Api {
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useLayoutEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* a first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useLayoutEffectWithDeps]].
*
* @see https://reactjs.org/docs/hooks-reference.html#useLayoutEffect
*/
@@ -283,8 +280,7 @@ object Api {
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useLayoutEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* a first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useLayoutEffectWithDeps]].
*
* @see https://reactjs.org/docs/hooks-reference.html#useLayoutEffect
*/
@@ -323,7 +319,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* This will only execute the effect when values in a first argument, change.
* This will only execute the effect when values in the first argument change.
*
* @see https://reactjs.org/docs/hooks-reference.html#useLayoutEffect
*/
@@ -336,7 +332,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* This will only execute the effect when values in a first argument, change.
* This will only execute the effect when values in the first argument change.
*
* @see https://reactjs.org/docs/hooks-reference.html#useLayoutEffect
*/
@@ -350,8 +346,7 @@ object Api {
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useInsertionEffectWithDeps]].
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -365,8 +360,7 @@ object Api {
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useInsertionEffectWithDeps]].
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -379,9 +373,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* This will only execute the effect when your component is mounted.
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -394,9 +386,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* This will only execute the effect when your component is mounted.
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -409,9 +399,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* This will only execute the effect when values in the first argument change.
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -424,9 +412,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* This will only execute the effect when values in the first argument change.
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -720,8 +706,7 @@ object Api {
*
* By default, effects run after every completed render.
* If you'd only like to execute the effect when your component is mounted, then use [[useEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* a first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useEffectWithDeps]].
*
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
@@ -731,7 +716,7 @@ object Api {
/** The callback passed to useEffect will run after the render is committed to the screen. Think of effects as an
* escape hatch from React’s purely functional world into the imperative world.
*
* This will only execute the effect when values in a first argument, change.
* This will only execute the effect when values in the first argument change.
*
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
*/
@@ -755,8 +740,7 @@ object Api {
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useLayoutEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* a first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useLayoutEffectWithDeps]].
*
* @see https://reactjs.org/docs/hooks-reference.html#useLayoutEffect
*/
@@ -769,7 +753,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* This will only execute the effect when values in a first argument, change.
* This will only execute the effect when values in the first argument change.
*
* @see https://reactjs.org/docs/hooks-reference.html#useLayoutEffect
*/
@@ -796,8 +780,7 @@ object Api {
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useInsertionEffectWithDeps]].
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -810,9 +793,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* This will only execute the effect when values in the first argument change.
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -825,9 +806,7 @@ object Api {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* This will only execute the effect when your component is mounted.
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ trait react17 {
*
* By default, effects run after every completed render. If you'd only like to execute the effect
* when your component is mounted, then use [[useEffectOnMount]]. If you'd only like to execute the
* effect when certain values have changed, provide those certain values as the second argument.
* effect when certain values have changed, then use [[useEffectWithDeps]].
*
* @see
* https://reactjs.org/docs/hooks-reference.html#useeffect
@@ -96,7 +96,7 @@ trait react17 {
* The callback passed to useEffect will run after the render is committed to the screen. Think of
* effects as an escape hatch from React’s purely functional world into the imperative world.
*
* This will only execute the effect when values in the second argument, change.
* This will only execute the effect when values in the first argument change.
*
* @see
* https://reactjs.org/docs/hooks-reference.html#useeffect
@@ -115,7 +115,7 @@ trait react17 {
*
* If you'd only like to execute the effect when your component is mounted, then use
* [[useLayoutEffectOnMount]]. If you'd only like to execute the effect when certain values have
* changed, provide those certain values as the second argument.
* changed, then use [[useLayoutEffectWithDeps]].
*
* @see
* https://reactjs.org/docs/hooks-reference.html#useLayoutEffect
@@ -145,7 +145,7 @@ trait react17 {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* This will only execute the effect when values in the second argument, change.
* This will only execute the effect when values in the first argument change.
*
* @see
* https://reactjs.org/docs/hooks-reference.html#useLayoutEffect
Original file line number Diff line number Diff line change
@@ -51,8 +51,7 @@ trait react18 {
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* If you'd only like to execute the effect when certain values have changed, then use [[useInsertionEffectWithDeps]].
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -65,9 +64,7 @@ trait react18 {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* This will only execute the effect when your component is mounted.
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
@@ -80,9 +77,7 @@ trait react18 {
*
* Prefer the standard [[useEffect]] when possible to avoid blocking visual updates.
*
* If you'd only like to execute the effect when your component is mounted, then use [[useInsertionEffectOnMount]].
* If you'd only like to execute the effect when certain values have changed, provide those certain values as
* the first argument.
* This will only execute the effect when values in the first argument change.
*
* @see https://react.dev/reference/react/useInsertionEffect#useInsertionEffect
*/
Loading