Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Allow (and ignore) booleans as children of components #15

Merged
merged 4 commits into from
Jan 15, 2018

Conversation

AmaranthineCodices
Copy link
Contributor

This closes #14. It allows for the children table passed to Roact.createElement to contain boolean values, which will be silently ignored. This enables the use of the pattern condition and Roact.createElement - without this patch, if condition is false, an error is thrown.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 84.416% when pulling 5e0c560 on AmaranthineCodices:master into 3fd4cff on Roblox:master.

@LPGhatguy
Copy link
Contributor

Can you add a test case for the behavior? I think it might be time to create a Reconciler.spec.lua file for cases like this, but it can start out just describing this behavior.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.9%) to 85.714% when pulling d299a7c on AmaranthineCodices:master into 3fd4cff on Roblox:master.

@AmaranthineCodices
Copy link
Contributor Author

This should cover the boolean-reification behavior; I'll save the rest of Reconciler.lua for another PR.

@LPGhatguy
Copy link
Contributor

Look good! The test file looks like it's indented with four spaces instead of tabs though; once you fix that it should be set to merge!

@AmaranthineCodices
Copy link
Contributor Author

Whoops, fixed now!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.9%) to 85.714% when pulling a313e61 on AmaranthineCodices:master into 3fd4cff on Roblox:master.

@LPGhatguy LPGhatguy merged commit f0a9981 into Roblox:master Jan 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Roact should reify booleans as nil
3 participants