* replace next with vite
* disable strictmode (it interferes with collaboration in dev mode)
This commit is contained in:
Philipinho
2023-10-20 17:12:08 +01:00
parent a86991e3d7
commit 9b682c8af5
96 changed files with 645 additions and 505 deletions
@@ -0,0 +1,28 @@
import React, { ReactElement } from 'react';
import { useElementSize } from '@mantine/hooks';
import { useMergedRef } from '@mantine/hooks';
type Props = {
children: (dimens: { width: number; height: number }) => ReactElement;
};
const style = {
flex: 1,
width: '100%',
height: '100%',
minHeight: 0,
minWidth: 0,
};
export const FillFlexParent = React.forwardRef(function FillFlexParent(
props: Props,
forwardRef
) {
const { ref, width, height } = useElementSize();
const mergedRef = useMergedRef(ref, forwardRef);
return (
<div style={style} ref={mergedRef}>
{width && height ? props.children({ width, height }) : null}
</div>
);
});