Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CrastyCrap's avatar

Props Doesn't update

Hello, i have variable in the parent i am trying to pass it to child and at this point all thing are good but when i try to update the value of props from parent it doesnt change in child parent

        <Pagination :currentPage="pages.current" :totalPages="totalPages" @paginate="Paginate($event)"></Pagination>
let totalPages = ref(1);

Child

const props = defineProps(['currentPage','totalPages']);
const emit =  defineEmits(['paginate']);

let currentPage = ref(props.currentPage);
let totalPages = ref(props.totalPages);
0 likes
1 reply
ramonrietdijk's avatar

Just to be sure, are you updating totalPages correctly?

totalPages.value = 2;

Please or to participate in this conversation.