Skip to content

Raw mode bypasses attr->prop translations

Choose a tag to compare

@tdumitrescu tdumitrescu released this 08 Dec 20:17
· 107 commits to master since this release

The rawProps option turns off translation of Jade attributes to HTMLElement properties. In this mode, for instance, the following Jade:

label(for='myEl')

will produce roughly the following JS:

h('label', {for: 'myEl'})

rather than auto-translating the for attr to the htmlFor prop.

This is now the default for the Snabbdom config, allowing direct usage of Snabb's top-level keys for modules such as props, attrs, class, etc:

label.my-class(
  class={'a-second-class': true}
  props={htmlFor: 'myEl'}
)