How to use re-resizable - 1 common examples

To help you get started, we’ve selected a few re-resizable 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 meetalva / alva / packages / core / src / container / app-pane.tsx View on Github external
import * as React from 'react';
import { WithStore } from '../store';
import * as Types from '@meetalva/types';

export interface AppPaneProps {
	pane: Types.AppPane;
	force?: boolean;
	children: React.ReactNode;
	size?: { width: number | string; height: number | string };
	defaultSize?: { width: number | string; height: number | string };
	enable?: { top?: boolean; right?: boolean; bottom?: boolean; left?: boolean };
	minWidth?: number;
	minHeight?: number;
}

const Resizeable = require('re-resizable').default;

@MobxReact.inject('store')
@MobxReact.observer
export class AppPane extends React.Component {
	public render(): JSX.Element | null {
		const props = this.props as AppPaneProps & WithStore;
		const app = props.store.getApp();

		if (!props.force && !app.isVisible(props.pane)) {
			return null;
		}

		const paneSize = props.size || props.pane ? app.getPaneSize(props.pane) : undefined;

		const defaultSize = paneSize
			? { width: paneSize.width, height: paneSize.height }

re-resizable

Resizable component for React.

MIT
Latest version published 4 days ago

Package Health Score

84 / 100
Full package analysis

Popular re-resizable functions