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

Prevent firing Change events when a component is unmounting #279

Open
benbrimeyer opened this issue Jun 26, 2020 · 0 comments
Open

Prevent firing Change events when a component is unmounting #279

benbrimeyer opened this issue Jun 26, 2020 · 0 comments

Comments

@benbrimeyer
Copy link

Was having issues creating a simple repro, but had ran into issue with this when unmounting a TextBox that has a Roact.Change.Text assignment. The function bound to Roact.Change.Text calls setState which would invoke the following error when unmounting:

    CorePackages.Packages._Index.roblox_roact.roact.createSignal:52: Listeners can only be disconnected once.
  In element:
  <enable element tracebacks>

      Stack Begin
      Script 'CorePackages.Packages._Index.roblox_roact.roact.RobloxRenderer', Line 268 - function updateHostNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 234 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 111 - function updateVirtualNodeWithChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.RobloxRenderer', Line 273 - function updateHostNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 234 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 111 - function updateVirtualNodeWithChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.RobloxRenderer', Line 273 - function updateHostNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 234 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 111 - function updateVirtualNodeWithChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.RobloxRenderer', Line 273 - function updateHostNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 234 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 111 - function updateVirtualNodeWithChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.RobloxRenderer', Line 273 - function updateHostNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 234 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 119 - function updateVirtualNodeWithRenderResult
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 496 - function __resolveUpdate
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 434 - function __update
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 238 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 119 - function updateVirtualNodeWithRenderResult
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 496 - function __resolveUpdate
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 434 - function __update
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 238 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 119 - function updateVirtualNodeWithRenderResult
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 496 - function __resolveUpdate
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 434 - function __update
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 238 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 119 - function updateVirtualNodeWithRenderResult
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 496 - function __resolveUpdate
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 434 - function __update
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 238 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 111 - function updateVirtualNodeWithChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.RobloxRenderer', Line 273 - function updateHostNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 234 - function updateVirtualNode
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 72 - function updateChildren
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 119 - function updateVirtualNodeWithRenderResult
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 496 - function __resolveUpdate
      Script 'CorePackages.Packages._Index.roblox_roact.roact.Component', Line 434 - function __update
      Script 'CorePackages.Packages._Index.roblox_roact.roact.createReconciler', Line 238 - function updateVirtualNode
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants