The duplicated component prop types SkeletonDisplayTextProps and SkeletonBodyTextProps have been removed. Use the single unified SkeletonTextProps instead.
Both removed types were structurally identical to SkeletonTextProps, which meant:
- Duplicate maintenance and doc noise
- Confusing autocomplete results
- Unnecessary import surface
Unifying them reduces API surface and keeps the mental model simple: all textual skeleton variants (DisplayText / BodyText / Text) share the same props.
- Replace any type imports of
SkeletonDisplayTextPropsorSkeletonBodyTextPropswithSkeletonTextProps. - If you were extending those interfaces in your own component wrappers, update the
extendsclause. - No runtime / behavioral changes are required—only TypeScript types.
-import type { SkeletonDisplayTextProps } from '@contentful/f36-skeleton';
+import type { SkeletonTextProps } from '@contentful/f36-skeleton';
-type HeadingSkeletonProps = SkeletonDisplayTextProps & { align?: 'left' | 'center' };
+type HeadingSkeletonProps = SkeletonTextProps & { align?: 'left' | 'center' };-import type { SkeletonBodyTextProps } from '@contentful/f36-skeleton';
+import type { SkeletonTextProps } from '@contentful/f36-skeleton';
-function ParagraphSkeleton(props: SkeletonBodyTextProps) {
+function ParagraphSkeleton(props: SkeletonTextProps) {
return <Skeleton.BodyText {...props} />;
}No changes are needed for the JSX usage of the components themselves:
<Skeleton.DisplayText numberOfLines={1} />
<Skeleton.BodyText numberOfLines={3} offsetTop={32} />Only the types you import in TypeScript have changed.
You can migrate with a simple textual replace (case‑sensitive):
- Search for
SkeletonDisplayTextProps→ replace withSkeletonTextProps. - Search for
SkeletonBodyTextProps→ replace withSkeletonTextProps.
Example shell (macOS / GNU compatible):
grep -Rl "SkeletonDisplayTextProps" ./src | xargs sed -i '' 's/SkeletonDisplayTextProps/SkeletonTextProps/g'
grep -Rl "SkeletonBodyTextProps" ./src | xargs sed -i '' 's/SkeletonBodyTextProps/SkeletonTextProps/g'If you prefer a tiny jscodeshift codemod:
// replace-skeleton-prop-types.js
export default function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
root
.find(j.Identifier, { name: 'SkeletonDisplayTextProps' })
.forEach((p) => (p.value.name = 'SkeletonTextProps'));
root
.find(j.Identifier, { name: 'SkeletonBodyTextProps' })
.forEach((p) => (p.value.name = 'SkeletonTextProps'));
return root.toSource();
}Run with:
npx jscodeshift -t replace-skeleton-prop-types.js "src/**/*.{ts,tsx}"Q: Do I need to update my runtime props? A: No. Only the exported type names changed.
Q: Will Skeleton.DisplayText or Skeleton.BodyText be removed?
A: No. This change only affects TypeScript type exports.
Q: What if I had both old types imported?
A: You can safely collapse them into a single SkeletonTextProps import.
Replace the removed types with SkeletonTextProps. No behavior changes, just a leaner public API.