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

TouchableOpacity only supports a single child #1354

Closed
pwmckenna opened this issue May 20, 2015 · 7 comments
Closed

TouchableOpacity only supports a single child #1354

pwmckenna opened this issue May 20, 2015 · 7 comments
Assignees
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@pwmckenna
Copy link
Contributor

the following code triggers fails an invariant check:

            <TouchableOpacity>
                <Text>hi</Text>
                <Text>hi</Text>
            </TouchableOpacity>

screen shot 2015-05-20 at 12 14 50 pm
screen shot 2015-05-20 at 12 15 00 pm

@pwmckenna
Copy link
Contributor Author

this may just be documentation error, so if this is expected I can make a PR for the doc update.

@MossP
Copy link

MossP commented May 22, 2015

Probably is a docs error. In the meantime you can wrap the inner elements in a view. I believe that the opacity is applied to that single child rather than cycling though each sub child element.

@brentvatne
Copy link
Collaborator

@pwmckenna - is there somewhere in the documentation where it's mentioned that you can use multiple children? If so, we should definitely fix that 😄

@brentvatne brentvatne self-assigned this May 24, 2015
@pwmckenna
Copy link
Contributor Author

@brentvatne it doesn't say either way, but its pretty adamant about only using one in practice. I'm not sure how the styling is applied if you wrap everything in a View as @MossP suggests.

@ide
Copy link
Contributor

ide commented May 24, 2015

+1 to updating the docs

@brentvatne
Copy link
Collaborator

@pwmckenna - haha good point, do you have time to put together a PR that updates the docs to indicate this?

@pwmckenna
Copy link
Contributor Author

sure, i'll give it a go. I've been meaning to take a peak at that other doc issue as well. I'll see if I can't do both while I'm in there.

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants