if(!data?._type === 'page')
This condition will always return 'false' since the types 'boolean' and 'string' have no overlap.
!foo === 'bar'
if (data?._type !== 'page')
bool === string
Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.