TypeScript
TypeScript copied to clipboard
compile target es6 static properties outside body class
tsconfig
- target: es6
- modules: es6
typescript
class App extends Component {
static defaultProps = { initialCount: 0 };
render() {
return (
<div>
<h1>Count: {App.defaultProps.initialCount}</h1>
</div>
);
}
}
js/es6
class App extends Component {
render() {
return (
<div>
<h1>Count: {App.defaultProps.initialCount}</h1>
</div>
);
}
}
App.defaultProps = { initialCount: 0 };
Can you talk about why this is unexpected, or what you'd like to have happen instead?