responsive-system 1.4.5 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react'
1
+ import React, { useState, useEffect } from 'react'
2
2
  import { ResponsiveProvider } from './index'
3
3
  import { useResponsive } from '../hooks'
4
4
  import { ResponsiveLayoutContext } from '../context'
@@ -32,7 +32,12 @@ const ResponsiveLayoutProviderInner: React.FC<ResponsiveLayoutProviderInnerProps
32
32
  const customResponsive = useResponsiveHook?.()
33
33
  const responsive = customResponsive || internalResponsive
34
34
 
35
- const [currentLayout, setCurrentLayout] = useState(defaultLayout)
35
+ const [currentLayout, setCurrentLayout] = useState(() => defaultLayout)
36
+
37
+ // Asegurar que el layout se inicialice correctamente con el defaultLayout
38
+ useEffect(() => {
39
+ setCurrentLayout(defaultLayout)
40
+ }, [defaultLayout])
36
41
 
37
42
  const layoutConfig = LAYOUT_CONFIG[currentLayout] || LAYOUT_CONFIG[DEFAULT_LAYOUT]
38
43