You can use the $watch method to watch for changes in the $page.props.page and update the form accordingly.
let form = reactive({
name: ''
});
$watch('$page.props.page', (newVal) => {
form.name = newVal.name;
});
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
'm loading a view where the Page model is passed into the main props so accessible at $pages.props.page.
How to have a reactive form which initialises with the props values?
let form = reactive({ name: ''", });
e.g. onMounted how to set form.name to $page.props.name?
Please or to participate in this conversation.