Components without props throw error

Created on 5 September 2023, 10 months ago
Updated 18 June 2024, 8 days ago

Problem/Motivation

As per SDC documentation, a props-less component (but with enforced schema) should use an empty properties entry:

# Even when we have no props, we need to add a schema of an empty object for them.
props:
  type: object
  additionalProperties: false
  properties: {}

Nevertheless, this will produce an error:

Array value found, but an object is required

Steps to reproduce

  1. Create a SDC component with the aforementioned props on its schema.
  2. Access any page: the error will appear.

Proposed resolution

Update validation to special-case empty arrays.

πŸ› Bug report
Status

Fixed

Version

10.2 ✨

Component
single-directory componentsΒ  β†’

Last updated about 22 hours ago

Created by

πŸ‡ͺπŸ‡ΈSpain idiaz.roncero Madrid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024