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

Tagging #184

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

AmaranthineCodices
Copy link
Contributor

Lets you tag rendered Roact instances with Roact.Tag:

local function Test(props)
    return Roact.createElement("Frame", {
        BackgroundColor3 = props.backgroundColor,
        [Roact.Tag] = "Test"
    })
end

Currently needs lemur changes for unit tests to pass.

@LPGhatguy LPGhatguy added the status: blocked externally Cannot be resolved until an issue in another project is closed. label Apr 19, 2019
@AmaranthineCodices AmaranthineCodices changed the base branch from new-reconciler to master May 6, 2019 17:57
@LPGhatguy
Copy link
Contributor

@tiffany352 mentioned that it would be useful to assign multiple tags to the same instance.

We could accomplish that with a key like Roact.Event:

Roact.createElement("Frame", {
    [Roact.Tag.Foo] = true,
    [Roact.Tag.Bar] = true,
})

We would choose this over a list of tags because:

  • Diffing lists quickly is difficult
  • Creating an extra table per render is heavy
  • Accepting a string or list makes the API more confusing/complicated to implement

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: blocked externally Cannot be resolved until an issue in another project is closed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants