wonderful-panda/vue-tsx-support

Property 'htmlfor' on <label>

dvic opened this issue · 1 comments

dvic commented

I have a question about the htmlfor attribute for <label>:

htmlfor?: string;

First of all, shouldn't this be camel case, like htmlFor? Or doesn't this matter? https://reactjs.org/docs/dom-elements.html#htmlfor

In any case, using htmlfor (or htmlFor when I change the type definition) does not result in having <label for="..."> in the HTML but <label htmlfor="...">. Does anyone know why this is happening? Maybe this is an issue with the vue jsx babel preset (https://github.com/vuejs/jsx/tree/dev/packages/babel-preset-jsx)?

dvic commented

Now that I have read https://github.com/vuejs/jsx/tree/dev/packages/babel-plugin-transform-vue-jsx#difference-from-react-jsx, shouldn't the property be called for instead of htmlfor in Vue's case? Similar to how in Vue JSX you have to use class instead of className?