-
Notifications
You must be signed in to change notification settings - Fork 122
Fix renderable children #29
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
Conversation
|
Thanks @Andrewpk! Will review and test tomorrow. Can you squash your commits?? |
|
@alvaromb sure! |
6ff23eb to
3abb743
Compare
|
@alvaromb Also, I think you can have merges default squashed as a repository owner now as well: |
|
No worries. I hope all is well. I've been using my PR branch in my project for about a week now. You are correct, it would fix and close #15 as well. -Andrew
|
5c5ea40 to
3fb8fa0
Compare
|
Sorry for wiping out some history here but I'm trying to keep my commits to one as you requested. I recently merged in master. |
|
Hello @Andrewpk! I've just tested the code, could you please update your PR with the latest changes on master? I can merge today this. Thanks! |
3fb8fa0 to
b0256fe
Compare
|
@alvaromb sorry for the delay - merged in, rebased and pushed! |
|
@Andrewpk the PR looks good, I'm testing it right now. However the example throws a warning because in the iterator you should define some Can you update this and check that all tabs are set to two spaces? Squash your commits if you can, too 😊 |
|
Just one more thing, can you document these changes into the |
|
Sure. I forgot I made that change locally and never pushed 😓 |
c880ebb to
0e9bf49
Compare
|
I updated the
|
… allowed. Multiple children can be nested in a single Button element. Added information to Readme. Changed PropTypes.node allowance to PropTypes.number. This way we don't have to check if an array of numbers or strings was passed via variable. Had to change required child to be of type PropTypes.node otherwise numbers passed in jsx variables would be denied.
0e9bf49 to
a8d93c5
Compare
|
Had to make one more change, going back to allowing the react type of children to be of type |
|
Thanks @Andrewpk! Will check and test the code now. Do you have any cool example that I can insert into the |
|
@alvaromb The best example I have is using buttons with icons from a vector icon library that uses font awesome. Do you have any issues with me adding an external dependency to the example project in order to bring the icons in? |
|
@alvaromb as an alternative to pulling in a dependency, I could make a examples with nested |
|
Closing by #45. |

This PR loosens the requirements on children and allows any number of elements nested inside a button as long as they're either a string, or valid react elements.
The button
textStyleproperty is optional and only applied to bare strings. If you specify child elements that are of<Text>type, you'll want to specify your own style on that<Text>element. This keeps the original functionality but expands upon it for further customization.