@@ -16,7 +16,6 @@ import {
1616 toNumber ,
1717 noop ,
1818} from 'lodash-es'
19- import { v4 as uuid } from 'uuid'
2019
2120/* Internal dependencies */
2221import useLayoutDispatch from '../../hooks/useLayoutDispatch'
@@ -187,34 +186,31 @@ forwardedRef: React.Ref<NavigationHandles>,
187186 } , [ navOptions ] )
188187
189188 const NavigationAreasComponent = useMemo ( ( ) => {
190- const childrens = React . Children . toArray ( children )
191-
192189 navigationRefs . current = [ ]
193190
194- return (
195- childrens . map ( ( navChildren , index ) => {
196- // TODO: instanceof 등으로 NavigationContent가 안 내려오면 warning을 띄워주는 것이 좋을 듯
197- if ( ! navOptions [ index ] || ! React . isValidElement < NavigationContentProps > ( navChildren ) ) { return null }
198-
199- return (
200- < NavigationArea
201- key = { uuid ( ) }
202- ref = { ( element : HTMLDivElement ) => {
203- set ( navigationRefs . current , [ index , 'target' ] , element )
204- set ( navigationRefs . current , [ index , 'minWidth' ] , navOptions [ index ] . minWidth )
205- set ( navigationRefs . current , [ index , 'maxWidth' ] , navOptions [ index ] . maxWidth )
206- } }
207- disableResize = { navOptions [ index ] . disableResize }
208- hidable = { navOptions [ index ] . hidable }
209- optionIndex = { index }
210- onMouseDown = { handleMouseDown }
211- onMouseMove = { handleMouseMove }
212- >
213- { navChildren }
214- </ NavigationArea >
215- )
216- } )
217- )
191+ return React . Children . map ( children , ( navChildren , index ) => {
192+ // TODO: instanceof 등으로 NavigationContent가 안 내려오면 warning을 띄워주는 것이 좋을 듯
193+ if ( ! navOptions [ index ] || ! React . isValidElement < NavigationContentProps > ( navChildren ) ) { return null }
194+
195+ return (
196+ < NavigationArea
197+ /* eslint-disable-next-line react/no-array-index-key */
198+ key = { `navigation-area-${ index } ` }
199+ ref = { ( element : HTMLDivElement ) => {
200+ set ( navigationRefs . current , [ index , 'target' ] , element )
201+ set ( navigationRefs . current , [ index , 'minWidth' ] , navOptions [ index ] . minWidth )
202+ set ( navigationRefs . current , [ index , 'maxWidth' ] , navOptions [ index ] . maxWidth )
203+ } }
204+ disableResize = { navOptions [ index ] . disableResize }
205+ hidable = { navOptions [ index ] . hidable }
206+ optionIndex = { index }
207+ onMouseDown = { handleMouseDown }
208+ onMouseMove = { handleMouseMove }
209+ >
210+ { navChildren }
211+ </ NavigationArea >
212+ )
213+ } )
218214 } , [ children , handleMouseDown , handleMouseMove , navOptions ] )
219215
220216 return (
0 commit comments