pugjs / babel-plugin-transform-react-pug

A plugin for transpiling pug templates to jsx
MIT License
811 stars 47 forks source link

How to use conditional className ? #106

Closed cihanzenginff closed 5 years ago

cihanzenginff commented 5 years ago

Hello, i worried how assign conditional classNames with your plugin?

i tried:

Input(className=this.state.val ? "active" : null)

but not worked

ezhlobo commented 5 years ago

@cihanzenginff your example should work fine:

https://react.pugjs.org/repl#%7B%22code%22:%22cHVnYAogIElucHV0KGNsYXNzTmFtZT10aGlzLnN0YXRlLnZhbCA/ICJhY3RpdmUiIDogbnVsbCkKYA==%22%7D

I see that you closed the issue, but if there is any question left, please, let me know ;)