diff --git a/src/components/layer.tsx b/src/components/layer.tsx index 37fe355..b4e6069 100644 --- a/src/components/layer.tsx +++ b/src/components/layer.tsx @@ -1,21 +1,25 @@ import react from 'react'; +import { useSelector } from 'react-redux'; import { ViewportState } from './viewport'; import '../theme/layer.css'; const Layer: react.FC<{ - viewportState: ViewportState; children?: JSX.Element; -}> = (props: { viewportState: ViewportState; children?: JSX.Element }) => { - const { children: children, ...argProps } = props; - console.log(`--- Rendering layer, props: ${JSON.stringify(argProps)} ---`); +}> = (props: { children?: JSX.Element }) => { + const viewportState = useSelector( + (state: { slippy: ViewportState }) => state.slippy + ); + console.log( + `--- Rendering layer, viewportState: ${JSON.stringify(viewportState)} ---` + ); return (