Skip to content

Commit

Permalink
[fix] Guard against constructing without params in diffProps
Browse files Browse the repository at this point in the history
  • Loading branch information
krispya committed Nov 20, 2023
1 parent 7ea6c52 commit fa978ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/fiber/src/core/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export function diffProps<T = any>(
// has no means to do this. Hence we curate a small collection of value-classes
// with their respective constructor/set arguments
// For removed props, try to set default values, if possible
if (root.constructor) {
if (root.constructor && root.constructor.length === 0) {
// create a blank slate of the instance and copy the particular parameter.
let ctor = DEFAULTS.get(root.constructor)
if (!ctor) {
Expand Down

0 comments on commit fa978ba

Please sign in to comment.