プロジェクトに単純な問題がありSubComponent
ます。その内部で変更を加えても、SubComonent
ホットリロードされません。修正方法がわかりません。
次のように定義されたコンポーネントがあります。
// Component.tsx
export const Component = () => {
return <div>Component</div>;
};
Component.SubComponent = function SubComponent() {
return <div>Hello From Sub</div>;
};
export const SubComponent1 = function SubComponent1() {
return <div>Hello From Sub1</div>;
};
そして使用法:
// App.tsx
<Component.SubComponent />
<SubComponent1 />
変更しComponent.SubComponent
てもリロードされませんが、変更しSubComponent1
てもうまくいきます。
これをクリーンな create-react-app インストールでテストしましたが、そこでも機能しません。
これを修正する方法、またはコードの何が問題なのかについてのアイデアはありますか? インターネットでサブコンポーネントに関する記事をたくさん見つけました。