I have a component that renders it's template with for example a span that looks like:
<span>{{item.name}}</span>
the item is passed in as a property:
props: {
item: null
},
when the component is first mounted item is null, so when the render happens I get this in the logs:
[Vue warn]: Error in render: "TypeError: Cannot read property 'name' of null"
If I create a computed property like this:
computed: {
name() {
if (this.item != null) {
return this.item.name
}
}
},
And then put name instead of item.name in the render it works fine, but is there a way to tell Vue to stop complaining about subproperties being null since it doesn't seem to care about root properties being null?
Maybe @LinusBorg knows?