Skip to content

CPLAT-8042 Implement/Expose useLayoutEffect Hook #248

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

Merged
merged 7 commits into from
Jan 24, 2020

Conversation

sydneyjodon-wk
Copy link
Collaborator

@sydneyjodon-wk sydneyjodon-wk commented Jan 16, 2020

Motivation

Support useLayoutEffect hook in react-dart.

Changes

  • Added useLayoutEffect function.
  • Wrote tests.

Please review: @greglittlefield-wf @aaronlademann-wf @joebingham-wk

@sydneyjodon-wk sydneyjodon-wk marked this pull request as ready for review January 17, 2020 00:11
Copy link
Collaborator

@joebingham-wk joebingham-wk left a comment

Choose a reason for hiding this comment

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

Everything looks really good to me! One tiny nit, but otherwise +1!

@@ -183,6 +184,47 @@ UseRefTestComponent(Map props) {
]);
}

final random = new Random();
Copy link
Collaborator

Choose a reason for hiding this comment

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

#nit no more new keyword!

Suggested change
final random = new Random();
final random = Random();

Copy link
Collaborator

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

+10, just one question

return React.useEffect(wrappedSideEffect, dependencies);
} else {
return React.useEffect(wrappedSideEffect);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume these changes mean passing in null for dependencies is the same as not passing it?

# Conflicts:
#	example/test/function_component_test.dart
#	lib/hooks.dart
#	lib/react_client/react_interop.dart
#	test/hooks_test.dart
Copy link
Collaborator

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

+10, will merge pending passing CI

@greglittlefield-wf greglittlefield-wf merged commit b638fd4 into 5.4.0-wip Jan 24, 2020
@aaronlademann-wf aaronlademann-wf added this to the 5.4.0 milestone Jan 29, 2020
@greglittlefield-wf greglittlefield-wf deleted the CPLAT-8042-useLayoutEffect-hook branch February 16, 2022 21:53
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