react-cosmos-renderer
Advanced tools
Comparing version 6.0.3-canary.ba5bf84.0 to 6.0.3
@@ -9,3 +9,3 @@ import { useEffect, useRef } from 'react'; | ||
const [propsFs, setPropsFs] = useFixtureState('props'); | ||
const prevFixtureRef = useRef(fixture); | ||
const prevFixtureRef = useRef(null); | ||
const elPaths = findRelevantElementPaths(fixture); | ||
@@ -44,2 +44,16 @@ useEffect(() => { | ||
else { | ||
// This code path is problematic because we can't tell whether: | ||
// a) This is the first time the fixture renders | ||
// b) A (suboptimal) HMR update blew up the FixtureCapture instance | ||
// For this reason we have a tradeoff: | ||
// - Override new fixture element props with fixture state props values | ||
// - Override fixture state props with new fixture element props values | ||
// We chose the latter because it makes HMR more reliable by allowing | ||
// users to update props in Node fixtures via source code (when HMR | ||
// isn't working optimally, which might be common.) | ||
// The downside with this approach is that a renderer that loads a | ||
// fixture with fixture state will ignore props from the fixture state | ||
// initially. This is more of an edge case that probably few people will | ||
// run into. For more context, see: | ||
// https://github.com/react-cosmos/react-cosmos/pull/1614 | ||
const prevChildEl = getElementAtPath(prevFixtureRef.current, elPath); | ||
@@ -46,0 +60,0 @@ if (!areNodesEqual(prevChildEl, childEl, false)) { |
{ | ||
"name": "react-cosmos-renderer", | ||
"version": "6.0.3-canary.ba5bf84.0+ba5bf84", | ||
"version": "6.0.3", | ||
"description": "React Cosmos Renderer", | ||
@@ -15,6 +15,6 @@ "repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-renderer", | ||
"lodash-es": "4.17.21", | ||
"react-cosmos-core": "6.0.3-canary.ba5bf84.0+ba5bf84", | ||
"react-cosmos-core": "^6.0.1", | ||
"react-is": "18.2.0" | ||
}, | ||
"gitHead": "ba5bf840dfe5e39566ccf6f262c36017bf5552d1" | ||
"gitHead": "a046d36222582e9750fc23fee9eaeed146f44633" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
70581
1489
1
0
+ Addedjs-base64@3.7.7(transitive)
+ Addedreact-cosmos-core@6.2.0(transitive)
+ Addedreact-is@18.3.1(transitive)
Updatedreact-cosmos-core@^6.0.1