Next.js Discord

Discord Forum

Difference in doing React.FC and importing FC from React and using it?

I was wondering if Nextjs offers inbuilt typescript support for React types as when I try using React.FC it doesnt import anything but when i use just FC it imports from react and it's size is around 7kb which might make some impact in the bundle size isn't it? Or are both the same?

4 Replies

You donÒ€ℒt need to use React.FC at all
Btw
const Component = (props: { name: string }) => {
  return <div>{props.name}</div>;
};
Is totally sufficient