-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMinimal.tsx
More file actions
29 lines (24 loc) · 712 Bytes
/
Copy pathMinimal.tsx
File metadata and controls
29 lines (24 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { useRef } from 'react';
import { useDetectWrappedElements, wrapChildrenClassName } from 'flex-wrap-layout';
import { createRoot } from 'react-dom/client';
import './Minimal.html';
import './Minimal.scss';
const boxStyle = {
border: '1px solid',
height: 60,
margin: 5,
padding: 5
};
function MyComponent() {
const ref = useRef(null);
useDetectWrappedElements(ref);
return (
<div ref={ref} className={wrapChildrenClassName}>
<div style={boxStyle}>Paris</div>
<div style={{ ...boxStyle, flex: 'auto' }}>Los Angeles</div>
<div style={boxStyle}>Phnom Penh</div>
</div>
);
}
const root = createRoot(document.getElementById('app')!);
root.render(<MyComponent />);