propTypes not transformed to vue
Opened this issue · 1 comments
armano2 commented
example:
import React from 'react';
class Display extends React.Component {
render() {
return (
<div className="component-display">
<div>
{this.props.value}
</div>
</div>
);
}
}
Display.propTypes = {
value: React.PropTypes.string,
};
export default Display;propTypes can be used to make 2 thinks in react:
- events in vue
- props in vue
we can determine this based on value of property if its React.PropTypes.func than this is an $emit
nickmessing commented
Hmm, looks possible with ComponentName.propTypes = {} and static propTypes = {}... I think we can use that as props index and use this.$props instead of this.$attrs, what do you think @egoist?
P.S. using on* for events is what I'd like to do since in Vue JSX this is the delimiter between event and prop so if you pass a prop like myCallback={(data) => console.log(data)} it will be a prop instead of event.