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.
- package/dist/responsive-system.cjs +3 -3
- package/dist/responsive-system.cjs.map +1 -1
- package/dist/responsive-system.mjs +121 -117
- package/dist/responsive-system.mjs.map +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +786 -786
- package/src/providers/ResponsiveLayoutProvider.tsx +7 -2
|
@@ -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
|
|