0
votes

I am working on a React project(primarily using Typescript). I want to pass some data from a non-component file to a React Component. So my question is,
Is there any way to pass the data from Simple JS/TS file to a React Component without using redux.

yes you can use useContext to do this - zain ul din
i want to pass data from inside of a function which will be executing in normal JS/TS file. myFunction() { /* wants to pass data from here */ } - kunalsrivastav