I am having trouble with my conditional statement. It only ever renders true even when it is false. I have a jobs list page that when pressed sets the 'selectedJob.' That job is then presented in a modal where you can save the job or remove it. But if the job is already been saved then I need the correct button to be displayed.
const [saved, setSaved] = useState(null);
useEffect(() => {
setSaved(selectedJob.saved);
}, [selectedJob]);
{saved ? (
<Button
onPress={() => removeJob(selectedJob)}
btnTxt={"Saved"}
/>
) : (
<Button
onPress={() => saveJob(selectedJob)}
btnTxt={"Save"}
/>
)}