Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AccordionPanel 開閉時にコンソールエラーが発生する問題を修正 #4777

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ export const AccordionPanelContent: FC<Props & ElementProps> = ({ className, ...
const isInclude = getIsInclude(expandedItems, name)
const wrapperRef = useRef<HTMLDivElement>(null)
const styles = useMemo(() => accordionPanelContent({ className }), [className])
const nodeRef = useRef<HTMLDivElement>(null)

return (
<Transition in={isInclude} timeout={150}>
<Transition in={isInclude} timeout={150} nodeRef={nodeRef}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refs: https://reactcommunity.org/react-transition-group/transition#Transition-prop-nodeRef

This prop is optional, but recommended in order to avoid defaulting to ReactDOM.findDOMNode, which is deprecated in StrictMode

とのことなので従う。 react-transition-group 自体もう2年間更新されていないので、この回避法で良さそう。

{(status) => (
<div
{...props}
Expand Down