adamhaile / surplus

High performance JSX web views for S.js applications
639 stars 26 forks source link

Forcing a non-hyphenated prop to be set as an attribute #70

Open trusktr opened 6 years ago

trusktr commented 6 years ago

How can we force a non-hyphenated prop to be set as an attribute instead of an instance variable? Is there a way?

trusktr commented 6 years ago

If it doesn't exist yet, it'd be a nice feature to have some way of making it possible via syntax.

The reason being that one might have some library (f.e. imagine a jQuery plugin) that looks for certain attributes in the DOM in order to apply behaviors.

<!-- Suppose it looks to see how many photos to paginate in a slider: -->
<div photoflow="5">
  <img src="..." />
  <img src="..." />
  <!-- ...  -->
</div>

Someone migrating to Surplus would still want for that to work, and for the attribute to exist on the element.