I'm new to Sanity.io. I'm just wondering if there is a way that I can optimize my codes and reuse the fields in different schemas.
Im thinking something like this:
cars.ts:
export default {
name: 'cars',
title: 'Cars',
type: 'document',
fields: [vehicleName]
}
trucks.ts:
export default {
name: 'trucks',
title: 'Trucks',
type: 'document',
fields: [vehicleName]
}
vehicleName.ts:
export const vehicleName = {
name: 'name',
title: 'Name',
type: 'string',
validation: Rule => Rule.required()
}