How to use the react-spaces.useParentSpace function in react-spaces

To help you get started, we’ve selected a few react-spaces examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aeagle / react-spaces / demo / src / ui-demo / Windows.tsx View on Github external
const WindowInner : React.FC<{ onClick?: () => void }> = (props) => {
    const parentSpace = Space.useParentSpace();

    return (
        <>
             { props.onClick && props.onClick(); parentSpace.startDrag(); }} size={40}>
                {Description(`Window title`)}
            
            
                {Description(`Window content`)}
            
        
    )
}

react-spaces

An easy to understand and nestable layout system, React Spaces allow you to divide a page or container into anchored, scrollable and resizable spaces enabling you to build desktop type user interfaces in the browser.

MIT
Latest version published 5 months ago

Package Health Score

65 / 100
Full package analysis