App.tsx
import "./styles.css";
import { Parent } from "./components/parent";
import { Child } from "./components/child";
export default function App() {
return <Parent child={Child} />;
}
Parent.tsx
import * as React from "react";
export const Parent: React.FC<{ child: React.FC }> = ({ child }) => {
return (
<div>
Hot Reload Works
{child({})}
</div>
);
};
Child.tsx
import * as React from "react";
export const Child: React.FC = () => {
return <div>Hot Reload Does Not Work</div>;
};
How do I enable Hot Reload for my Child Functional Component when passing it as a parameter to the Parent? I've included the code sandbox that shows that hot reloading does not work in the child component.