Open sampi opened 7 years ago
This might be a fix: https://gist.github.com/chinchang/a66fe3aedaf98b2433eb
workaroud:
const topBarAttr = {
'data-ts': 'TopBar',
'data-ts.title': 'asdfasdft'
}
render(
<header {...topBarAttr}></header>
)
I remember when we introduced this, JSX did not support custom attributes like ts-aside
(it does now) but it did support the the attribute in question, data-ts.icon
(it doesn't now). So this appears to be a moving target. Not sure what to do about it :cry: it would hurt to change this once again.
Reports are coming in that it is not working in Angular 2 as well.
I'm having similar issues with the data-ts.title
for asides. My framework seems to be preferring the data-ts-title
convention, and I see some data-ts-spirit
in the DOM as well. I also see nobody else using dots in data attributes, and it seems to be discouraged.
Perhaps start moving to only using dashes? or at least as an alternative.
@jypma We moved from dashes to dots precisely because dashes were at that time not supported in React, but that of course changed the week after and now React has a problem with dots; although it is still possible to get the attributes declared if you have the patience. It's a huge operation to change the syntax (again), but we agree that it should be done 😞
Tradeshift UI version affected
v7.0.0
Expected Behavior
I can use
data-ts.icon
attributes on my<input />
fieldsActual Behavior
I get a
Syntax error: Unexpected token
messageSteps to reproduce
Write
<input data-ts.icon="ts-icon-menuswitch" />
anywhere on a JSX page and try to compile it.