79437584

Date: 2025-02-13 20:00:48
Score: 2
Natty:
Report link

You can create you custom type for this

File: global.d.ts

import React from "react";

declare global {
declare namespace ReactCustom{
type FC<P = {}> = ReactCustom.FC<P & { children?: React.ReactNode }>;
}
}

where the error is, for example:

const UserContextProvider: React.FC = ({ children }) => { ... }

you just need replace all with type custom created, without much effort, and it would look like this:

const UserContextProvider: ReactCustom.FC = ({ children }) => {...}

Reasons:
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Rian R.