をレンダリングしないthis.variableと私は以下を参照のconstを作成しました:私が使用している場合リアクトコンポーネント私はこのコンポーネントを反応させてきた
export class MyComponent extends React.Component {
constructor() {
super();
const mytext = 'Some Text';
}
render() {
return (
<div>
{this.mytext}
</div>
);
}
}
はこのconstのはMYTEXTをレンダリングされていない{this.mytext}
何私は間違っている?
'const this.mytext = 'Some text';' {mytext} '......! – Jai
mytextのデータ型はconstです。だからあなたはそれを{this.mytext}から{mytext}に変更する必要があります – Ved
@Jai私はconst this.mytext = 'Some Text'と思います。構文が間違っています。 – Ved