import React from "react";
import { useRecoilState } from "recoil";
import { Industry, industryState } from "../atoms/industriesAtoms";
const useIndustryData = () => {
const [industryStateValue, setIndustryStateValue] =
useRecoilState(industryState);
const onJoinOrLeaveIndustry = (industryData: Industry, isJoined: boolean) => {
// is the user signed in
// if not => open auth modal
if (isJoined) {
leaveIndustry(industryData.id);
return;
}
joinIndustry(industryData);
// onJoinOrLeaveIndustry;
};
const joinIndustry = (industryData: Industry) => {};
const leaveIndustry = (industryId: string) => {};
return (
// data and functions,
*industryStateValue,* onJoinOrLeaveIndustry
);
};
export default useIndustryData;
I am working on the code above in a react project and I'm getting an error that Left side of comma operator is unused and has no side effects.ts(2695) in line 27 of the screenshot.
I want to understand why I am getting this error, and how I can resolve it.
I found a similar problem here, but the solution wasn't helpful in my own case.