[ReactNative] A VirtualizedList contains a cell which itself..์—๋Ÿฌ
728x90

์–ด๋–ค ์—๋Ÿฌ?

ํ”Œ๋žซ๋ฆฌ์ŠคํŠธ๋ฅผ ์—ฌ๋Ÿฌ ๊ฐœ ์‚ฌ์šฉํ•˜๋ ค๋‹ค ๋ณด๋‹ˆ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.

 

ERROR A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.

 

ํ”Œ๋žซ๋ฆฌ์ŠคํŠธ๊ฐ€ ์ค‘์ฒฉ๋˜์ง€ ์•Š๊ณ  ์—ฌ๋Ÿฌ๋ฒˆ ์“ฐ์ผ ๋•Œ ๋ชจ๋“  ํ˜•์ œ ๋ฆฌ์ŠคํŠธ์—๊ฒŒ ํ‚ค๊ฐ’์ด ํ•„์š”ํ•œ ๊ฒƒ ๊ฐ™์•˜๋‹ค.

 

์‚ฌ์‹ค ์—๋Ÿฌ์—์„œ ๋‹ต์„ ์ฃผ๊ณ ์žˆ์—ˆ์ง€๋งŒ listKey๊ฐ€ keyExtractor์™€ ์—ฐ๊ด€์ด ์žˆ๋Š”์ค„ ์•Œ๊ณ  ๋งŽ์€ ์‚ฝ์งˆ์„ ํ–ˆ๋‹ค (...)

key๊ฐ€ ์œ ๋‹ˆํฌํ•œ ๊ฐ’์ด ์•„๋‹ˆ์–ด์„œ ๊ทธ๋Ÿฐ๊ฐ€? ์‹ถ์–ด์„œ ์ด๋Ÿฐ ์‚ฝ์ง‘๋“ค์„ ํ–ˆ์—ˆ๋‹ค.

  • keyExtractor์—์„œ index๋„ ๊ฐ™์ด ๋ฐ›์•„์™€์„œ ์•„์ด๋””๊ฐ’+์ธ๋ฑ์Šค๊ฐ’์œผ๋กœ ํ‚ค ๋งŒ๋“ค๊ธฐ
  • uuid ์‚ฌ์šฉํ•ด๋ณด๊ธฐ

 

์ฒ˜์Œ ์ฐธ๊ณ ํ–ˆ๋˜ ๊ธ€.
https://stackoverflow.com/questions/49033549/invariant-violation-a-virtualizedlist-contains-a-cell-which-itself-contains-mor

 

Invariant Violation: A VirtualizedList contains a cell which itself contains more than one VirtualizedList

The complete error is: Invariant Violation: A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a ...

stackoverflow.com

 

 

ํ•ด๊ฒฐ

์•„๋ž˜์™€ ๊ฐ™์ด ํ”Œ๋žซ๋ฆฌ์ŠคํŠธ์— listKey ๋ผ๋Š” ์†์„ฑ์„ ๊ณ ์œ ํ•œ ๊ฐ’์œผ๋กœ ์ฃผ๋ฉด ๋ฌธ์ œ๋Š” ํ•ด๊ฒฐ๋œ๋‹ค!

 

 

 

 

์ฐธ๊ณ ๊ธ€


https://stackoverflow.com/questions/70721582/fix-this-react-native-error-virtualizedlist-contains-a-cell-which-itself-contain

 

Fix this React Native error VirtualizedList contains a cell which itself contains more than one VirtualizedList

When I load my React Native project, I am getting this Error: A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You ...

stackoverflow.com

 

728x90