-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[withWidth] Document the render prop #13074
[withWidth] Document the render prop #13074
Conversation
@JulienUsson Oh, I'm sorry for not being clear. I was suggesting using the recompose |
@@ -35,10 +36,14 @@ Sometimes, using CSS isn't enough. | |||
You might want to change the React rendering tree based on the breakpoint value, in JavaScript. | |||
We provide a `withWidth()` higher-order component for this use case. | |||
|
|||
In the following demo, we change the rendered DOM element (*em*, <u>u</u>, ~~del~~ & span) based on the screen width. | |||
In the following demo, we change the rendered DOM element (_em_, <u>u</u>, ~~del~~ & span) based on the screen width. |
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.
Can we keep the old convention? I think that it's better to reduce the entropy.
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.
Oops, sorry, i haven't seen that vscode autoformat it.
Yes, nice idea :) i will update my PR soon |
b9bd92d
to
aeee392
Compare
aeee392
to
2a5ba0d
Compare
Thanks! |
Hello,
This PR allows user to rename withWidth props like asked in #13074
You can rename props with
renameProps
.Do you think others HOC need this too?
Thanks,
Julien Usson
Closes #11952