I'm a bit new to typescript...wanna know is there anyway to export valur from a
funtional component in React? I'm using React with typescript
I tried this ==>
const Products: FC = () => {
const [products, setProducts] = useState<object[] | []>([])
export const productsContext = createContext<object[] | []>(products)
return (
<div>some code</div>
)
export default Products
}
when I try to export the productsContext ts tells that modifiers can't appear there
so is there anyway to export value from a FC?
thanks