Try this way
class AppProvider extends React.Component {
const functionOne = async (e) => {
try {
....
} catch (e) {
....
}
};
const functionTwo = async (e) => {
try {
....
} catch (e) {
....
}
};
render() {
return (
<AppContext.Provider
value={{
....
functionOne: this.functionOne,
functionTwo: this.functionTwo,
}}
>
{children}
</AppContext.Provider>
);
}
}
export default AppProvider;
* Be the first to Make Comment