Switch component to different one without lost its references

I'm using Retool to build basic apps but often I need to replace a component with another one for example switch a text component in a markdown text and this option is not present in the switch proprieties.

The question: is possible to create a new component and then act a switch beetween them at name level? because if I delete the old component I lost all its references in query, scripts, etc

For example I've "TxtDetail" as TextInput and I'd like to switch to new created "NewTxtDetail" without lost the references or if is possible migrating all the existent references from "TxtDetail" to "NewTxtDetail"

I hope this is a stupid question... with a stupid solution :wink:

Thank you!!

If you switching component types that should not cause a loss of references. But, if you are creating a new component then assign all of the same references to it manually and then delete the old component.

Hey Paolo, you can

  1. Delete TxtDetail
  2. Rename NewTxtDetail to TxtDetail
  3. Refresh app state

That should sync the references up too.

You might have errors if you were accessing properties of the old component that does not exist in the new one.