Hi @marcosbontempo,
The state has nothing to do with Marcos component unless you add another state which will load Marcos similar to next.qml. With your current approach you will need to make it hide explicitly using invisible but it wont destroy it and if you do it in similar way as you load next.qml then
states: [
State {
name: "next"
PropertyChanges {
target: loader
source: "next.qml"
}
extend: "none"
},
State {
name: "marcos"
PropertyChanges {
target: loader
source: "Marcos.qml"
}
extend: "none"
}
]
Here Loader will remove the earlier component and load the new one when the state changes.