~firefoxreact-appvite-appsrccomponents
componentsWindowSize.tsx
3 days ago• 4
{}
import React from 'react';
import { useAppSelector } from '../redux/hooks';
import { useWindowSize } from '../redux/hooks/useWindowSize';
const WindowSize: React.FC = () => {
// Use the custom hook to handle resize events
useWindowSize();
// Select window size from Redux store
const { width, height } = useAppSelector((state) => state.windowSize);
return (
<>
<p>
[Window Resolution;
Width: {width}px Height: {height}px]
</p>
</>
);
};
export default WindowSize;
Top
2 274 611 visits