StefanKovac / flex-layout-attribute

HTML layout helper based on CSS flexbox specification —
http://progressivered.com/fla/
MIT License
712 stars 57 forks source link

Attributes do not work with ReactJS #16

Closed danielkrich closed 6 years ago

danielkrich commented 7 years ago

Hey, The "layout" and "self" attributes do not work with React, because it removes them automatically. I tried to change the names in "_vars.scss" file, but it's still not working.

There is a workaround in React to include "custom" attributes by writing: <div is layout="row center center"> but it's not as clean as data-attributes. Is it possible that the names of the attributes are hard-coded ?

StefanKovac commented 6 years ago

Hi @danielkrich, is this still an issue?

React team enabled custom attributes from v16 as noted on: https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html

You can always add "data-" prefix to your attribute name and use it in html like: <div data-layout="row center center">