Skip to content

Commit

Permalink
Merge pull request #3098 from Nicetouchco/fix/primitive-diffProps
Browse files Browse the repository at this point in the history
[v9] Fix: Guard against constructing without params in diffProps
  • Loading branch information
krispya authored Dec 4, 2023
2 parents 1dc2b95 + fa978ba commit 9a61979
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 9a61979

Please sign in to comment.