Set a prop when make a successful visit #1035
-
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
When I click the inertia link, the So what is the problem? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @russellxrs Instead you could use e.g. a computed property or a separate state to achieve the same behaviour. Hope this helps :) |
Beta Was this translation helpful? Give feedback.
Hey @russellxrs
it is difficult to analyse why the described issue happens but in general you should never mutate a prop. Inertia had some support of transforming props and removed it because of similar reasons.
Instead you could use e.g. a computed property or a separate state to achieve the same behaviour.
Hope this helps :)