[@egjs/react-flicking] `firstPanelSize` prop also should be declared in `DEFAULT_PROPS`
yongholeeme opened this issue · 1 comments
Description
The firstPanelSize
prop is being passed to a DOM element, which causes a warning message in React. To resolve this, the firstPanelSize
prop should be declared in DEFAULT_PROPS
to prevent it from being passed to the DOM element.
The following warning message appears:
Warning: React does not recognize the `firstPanelSize` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `firstpanelsize` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
at div
at Flicking (webpack-internal:///(app-pages-browser)/./node_modules/.pnpm/@egjs+react-flicking@4.11.3_patch_hash=udhpmtst4xgefa6rulabjuz4nu/node_modules/@egjs/react-flicking/dist/flicking.esm.js:492:24)
This warning occurs because the firstPanelSize
prop is being passed to a DOM element, which React does not recognize. When an unknown prop is passed to a DOM element, React issues a warning.
To prevent the firstPanelSize prop from being passed to the DOM element, it should be declared in the component’s DEFAULT_PROPS
. This will ensure that React does not forward the prop to the DOM element.
Relevant code:
egjs-flicking/packages/react-flicking/src/react-flicking/Flicking.tsx
Lines 163 to 167 in 8e57219
egjs-flicking/packages/react-flicking/src/react-flicking/consts.ts
Lines 27 to 52 in 8e57219
Steps to check or reproduce
just pass firstPanelSize
prop into <Flicking />
Hello @yongholeeme.
We fixed this issue in #886 and released @egjs/react-flicking@4.12.0-beta.5, which resolves this issue.
We'll leave additional comment when this PR is merged and we release the patch.