[ ] Chore (a non-breaking change which is related to package maintenance)
[x] Bug fix (a non-breaking change which fixes an issue)
[ ] New feature (a non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
This PR changes <PrismicLink>'s development-only behavior to warn rather than throw when given an invalid Link field or Prismic document (in most cases; see the note below).
In addition to reducing the severity of an invalid field or document, this PR also fixes a bug where a valid unfilled Link field (i.e. a field that a content writer did not fill in) was treated as invalid. Unfilled Link fields are now treated as valid.
Note: <PrismicLink> will still throw if a link_type property is missing from the provided field prop value. link_type is required to detect the type of link and is populated even for unfilled Link fields.
Types of changes
Description
This PR changes
<PrismicLink>
's development-only behavior to warn rather than throw when given an invalid Link field or Prismic document (in most cases; see the note below).In addition to reducing the severity of an invalid field or document, this PR also fixes a bug where a valid unfilled Link field (i.e. a field that a content writer did not fill in) was treated as invalid. Unfilled Link fields are now treated as valid.
Note:
<PrismicLink>
will still throw if alink_type
property is missing from the providedfield
prop value.link_type
is required to detect the type of link and is populated even for unfilled Link fields.(Thanks to @kb1995 for discovering this bug!)
Checklist:
🐱