෦తͳࠩ͠ସ͑
ίϯϙʔωϯτͷҰ෦͕ෆ҆ఆͳ߹ ( e.g. YouTube ຒࠐಈը, iframe) ɺ
VRT ࣌ͷΈผ div ʹࠩ͠ସ͑ͯɺFlaky Test ʹͳΒͳ͍Α͏ʹ͢Δ
export function MyComponent() {
return (
{/* ͕͜͜ෆ҆ఆͳཁૉ */}
</div>
);
}
import { isScreenshot } from "storycap";
export function MyComponent() {
return (
<div>
{process.env.NODE_ENV !== "production" && isScreenshot() ? (
<div style={{ height: 400, background: "#888" }} />
) : (
<iframe
style={{ height: 400, width: "100%" }}
src="https://example.com/hogehoge"
/>
)}
</div>
);
}