score:0

Accepted answer

you need to set the boolean directly.

checked={setchecked(id)}

also in the setchecked function you can do the following modification. else when there is no matched elements it returns empty array which will still be true.

const setchecked = (ids) => boolean(bookmarksdata.find((e) => e.id === ids));

score:0

checked prop in checkbox component expects a boolean value, so you can do it like this

//the code in the loop where i display the posts

<checkbox
                  icon={<bookmarkbordericon />}
                  checkedicon={<bookmarkicon />}
                  checked={setchecked(id)}
                  onclick={() => savedbokmark({ id })}
 />

Related Query

More Query from same tag