Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
@swm/global nav menu v1 #28277
@swm/global nav menu v1 #28277
Changes from 31 commits
aacb4a6
fe7851f
5bc0dec
b1af947
2344abc
a966c89
76ef562
f8784a0
3c0295e
c83bad0
1c8c9db
5f10a5b
96197e3
a2c65db
ce4f907
d962df5
6001c23
0f29a39
95f47b3
dfd2e82
50117d7
36e6c61
6a361b2
c35523c
a5ae067
1f6da9f
ca99028
7250a2f
8bb5406
4c056fa
a6ad209
9e87953
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need
forwardedRef
prop. We should use the second parameterref
and inReact.forwardRef
we call the function directly without creating another layer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got this error/warning with this approach. Is there a way to fix it without creating another layer?
react.development.js:209 Warning: forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asked in the expensify-open-source channel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi folks @hayata-suenaga @adamgrzybowski , thank you for pointing this out!
Following the error, we cannot attach
propTypes
to render function insideforwardRef
, so in case where we needpropTypes
, I would simply fall back to declaring it inline (still omitting the indirectforwardedRef
prop):Let me know if that works in this case. If you find that useful, I will update the docs accordingly, thanks!
P.S.
Ideally we would use TS for constraining the props shape, so that would not be the issue and we will declare component directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamgrzybowski were you able to solve the issue?