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

Fix/remove default props/android layout drawer #32160

Closed

Conversation

mdaj06
Copy link
Contributor

@mdaj06 mdaj06 commented Sep 6, 2021

Summary

Removed the deaultProps in the DrawerLayoutAndroid file and replaced it with a default value in case props are undefined.

Changelog

[General] [Changed] - Remove defaultProps from the DrawerLayoutAndroid Component.
@lunaleaps this is the fix for issue #31606

Test Plan

Ran test suite

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 6, 2021
@analysis-bot
Copy link

analysis-bot commented Sep 6, 2021

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 4f0671b

@analysis-bot
Copy link

analysis-bot commented Sep 6, 2021

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,957,348 +0
android hermes armeabi-v7a 8,490,627 +0
android hermes x86 9,377,567 +0
android hermes x86_64 9,342,887 +0
android jsc arm64-v8a 10,639,592 +0
android jsc armeabi-v7a 9,560,390 +0
android jsc x86 10,654,090 +0
android jsc x86_64 11,263,091 +0

Base commit: 4f0671b

* );
* ```
*/
drawerBackgroundColor: ColorValue,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lunaleaps i think we can remove this because, when a user passes a custom prop to the component it will pick it up and replace the default value which is currently - "white". if we keep it here it would raise an error saying that drawerBackgroundColor is present in "Props"(read only flow interface) and not present inside the props in the DrawerLayoutAndroid Class component.

When the "static props" field was present this wasn't an issue as the class by default added it to the props object.

gradlew.bat Outdated
@@ -1,89 +1,89 @@
@rem
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly to #32133, you should not add gradlew.bat files to this PR (please don't git add --all otherwise you will add those files).

Copy link
Contributor Author

@mdaj06 mdaj06 Sep 7, 2021

Choose a reason for hiding this comment

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

yes doing a git add file-name would fix this, but wasnt sure as it appeared after i took a pull form the main branch. so shall i reverse the commit and only push the other relevant files? @cortinico . Not too sure with the exact reason why this kept showing up after the pull.

Copy link
Contributor

Choose a reason for hiding this comment

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

gradlew.bat Outdated
@@ -1,89 +1,89 @@
@rem
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding the .bat files, they were present from the moment i did a rebase from the "main" branch essentially. if you compare the left and right panes there are no changes. So this shouldn't affect the current code, but it is weird that i could not stash/revert these changes after a merge from the upstream main branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

There are indeed changes in terms of whitespaces. This is addressed by #31398 and you should not include them in your change as they're unrelated to your PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it! makes sense thanks for pointing this out 👍🏼

@mdaj06 mdaj06 closed this Sep 7, 2021
@mdaj06 mdaj06 force-pushed the fix/removeDefaultProps/AndroidLayoutDrawer branch from 45209b1 to 8c25711 Compare September 7, 2021 11:29
@mdaj06 mdaj06 deleted the fix/removeDefaultProps/AndroidLayoutDrawer branch September 7, 2021 11:29
@cortinico
Copy link
Contributor

The diff for this PR seems to be empty @mdaj06

@mdaj06
Copy link
Contributor Author

mdaj06 commented Sep 7, 2021

@cortinico this branch got closed on a revert so i have addressed all the issues mentioned above in PR #32162

@cortinico
Copy link
Contributor

Gotcha, sorry for the confusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants