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

Resolves Issue #521 Draft #541

Merged
merged 10 commits into from
Jun 10, 2018
Merged

Resolves Issue #521 Draft #541

merged 10 commits into from
Jun 10, 2018

Conversation

suhailnaw
Copy link
Contributor

Hi, I wanted to submit my first open source PR for issue #521 for some review!

Add ClientOnly as a property to ReactComponent. When ReactEnvironment.CreateComponent is called, ClientOnly needs to be set.

I believe I set this correctly in ReactEnvironment.cs on lines 305 and 307. Since this is a new parameter for ReactComponent, do I need to go in and add the ClientOnly parameter to every call of ReactComponent? Or should I set a default value?

When RenderJavaScript is called in ReactComponent, ClientOnly should be checked. If true, ReactDOM.render should be written to the script instead of ReactDOM.hydrate.

I used a ternary operator for the conditional in ReactComponent.cs on line 236. I saw ternary operators used in other parts of the codebase, is it appropriate to use here? Also, am I correctly referencing the ClientOnly property from the ReactComponent?

Let's make sure to add a unit test for this as well.

I added two unit tests, one for each case.

@dustinsoftware
Copy link
Member

Thanks for the PR. Please check the build failures by clicking the red X on the latest commit. Once the build passes let me know and I’ll give it some review :)

@dustinsoftware
Copy link
Member

Hi there @suhailnaw, do you have time to continue with this PR? If not I'll finish it up and merge it in.

@suhailnaw
Copy link
Contributor Author

I was having difficulty building locally on my Mac. Can I use NET Core for my first build using the dotnet build command?

@suhailnaw
Copy link
Contributor Author

Hey @dustinsoftware, I got the build to pass! Do you have any feedback on this PR?

@dustinsoftware
Copy link
Member

Looks good at a first glance. Need to pull down and test locally before merging.

@dustinsoftware
Copy link
Member

I had to bump React to a version higher than 16.0 to get the bug to repro. Thanks for the PR!

@dustinsoftware dustinsoftware merged commit 12ff098 into reactjs:master Jun 10, 2018
@Daniel15
Copy link
Member

Thanks @suhailnaw for submitting this pull request, and thanks @dustinsoftware for reviewing and merging it!

@suhailnaw
Copy link
Contributor Author

Thank you for all your support @dustinsoftware! Feels good to have an open source contribution under my belt :)

@dustinsoftware
Copy link
Member

@suhailnaw this has shipped, here are the release notes https://reactjs.net/2018/06/3.4.0-release.html

@suhailnaw
Copy link
Contributor Author

Awesome, thanks for the shoutout on the release notes @dustinsoftware, I really appreciate it!!

@Daniel15
Copy link
Member

I wrote the release notes 😄 Thanks for your pull request!

@suhailnaw
Copy link
Contributor Author

Thanks @Daniel15!! :)

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

3 participants