Jan 6, 2022
0
Level 23
Set a prop when make a successful visit
What I want to do is to new a class based on one of the props when I receive them from backend, so I can use class with methods instead of plain objects. This is what I do:
I register a success event on the entry file:
Inertia.on('success', (event) => {
event.detail.page.props.columnsMap = new ColumnsMap(event.detail.page.props.columnsMapOrigin);
});
When I click the inertia link, the columnsMap prop is successfully set while the progress bar is still moving.(I check it in vue dev tool)
But somehow it disapeared when the progress bar is ending. It's like beening reset when the visit finished.
So what is the problem?
Please or to participate in this conversation.