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

Remove values from setState #38

Merged
merged 4 commits into from
Mar 5, 2018

Conversation

AmaranthineCodices
Copy link
Contributor

This fixes #30. It adds a Roact.None symbol that, when used in setState, will remove the key from the state.

Usage:

-- state already contains a value named "value"
self:setState({
    value = Roact.None,
})

-- state no longer contains "value"

@coveralls
Copy link

coveralls commented Mar 4, 2018

Coverage Status

Coverage increased (+0.1%) to 84.917% when pulling 13dc159 on AmaranthineCodices:remove-from-setState into e554ad9 on Roblox:master.

lib/Core.lua Outdated
@@ -19,6 +19,9 @@ Core.Ref = Symbol.named("Ref")
-- Marker used to specify that a component is a Roact Portal.
Core.Portal = Symbol.named("Portal")

-- Market used to specify that the value is nothing, because nil cannot be stored in tables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo! s/Market/Marker

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Fixed now.

@LPGhatguy
Copy link
Contributor

Looks good to me!

@LPGhatguy LPGhatguy merged commit bb60936 into Roblox:master Mar 5, 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.

setState can't remove values from state
3 participants