-
Notifications
You must be signed in to change notification settings - Fork 7
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
feature idea: pass size as prop to child #5
Comments
Sure! I'll take a PR! |
Should it be opt-in? Something along the lines of a |
Great idea. Maybe, if that prop is left undefined, we don't pass it down? |
I'm having trouble getting the tests to run on my system, but I was thinking something like this: In the const sizeProp = this.props.sizeProp ? {
name: this.props.sizeProp,
value: className
} : null; then pass const sizePropName = sizeProp ? sizeProp.name : null
const sizePropValue = sizeProp ? sizeProp.value : null
return cloneElement(child, {className: classNames.join(' '), [sizePropName]: sizePropValue}) |
Seems right! |
This feature has not been implemented? In addition to passing the size, I'd like to able to pass custom values dependant on the size. The use case is elementary: I need to load different data depending on whats the container size. |
@gajus It hasn't. I'd happily take a PR! |
@joeybaker Would you consider handing over the namespace of the project? I'd happily take over the development seeing that this is a requirement inherent in the project I will be working on for a foreseeable future. There are quite a few things that I'd like to do different, starting with (1) using compile time to wrap (Otherwise I will just start working on it under a different name.) |
@gajus I'm very interested in adding you as an owner/collaborator! Let's start with a PR or two? Assuming we mostly see eye-to-eye on things, I'm more than happy to share responsibility. |
This would allow custom behavior in children without registering a callback function. What do you think?
The text was updated successfully, but these errors were encountered: