Something I would be curious about is what happens when you try to change the view. Like what if you want to make a counter. For me that was always the best thing about react.
(Think of an Item as a visual component, which can either be referred to by an id or, as I've done here, referred to by its children as "parent".)
Item {
property int count: 1
Button {
height: 30; width: 80
onClicked: parent.count++
}
Text {
height: 20; width: 30
text: parent.count
}
}
The text will update every time you click the button.What's nice about react is that the JSX syntax is just sugar that converts to function calls.
The standard way to do this in QML is using the Loader object: http://doc.qt.io/qt-5/qml-qtqml-component.html
You can also go full-eval of course: http://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation...