into your data and find the user's subscription state
return (
<>
<input type="checkbox" checked={!!subscribed} onChange={() => setSubscribed(!subscribed)} />
{ subscribed ? "Unsubscribe" : "Subscribe!" }
</>
);
i wan't to do it with setState
Обсуждают сегодня