Closed petervmeijgaard closed 6 years ago
That's expcted, you need to pass them as attrs:
render(h) {
let props = {
class: this.classes,
};
if (this.isExternal) {
props.attrs = { target: '_blank', rel: 'noopener noreferrer' }
}
console.log(props);
return (
<a {...props}>
{this.children}
</a>
);
I think this one is correct, Vue JSX is slightly different from react, you can find out more in createElement Arguments
Ah yes! That did the trick! I'm working with both Vue and React, so I was confused why it didn't work.
Goodday!
I ran into an issue when I was applying the spread operator on a custom component with JSX syntax. The properties that I want to apply, aren't applied correctly.
Example:
When using this example, you'll see that the classes are applied correctly, but the
rel
andtarget
are not.As you can see, the
console.log
is showing the object with all the properties.But the
rel
andtarget
aren't rendered.