I just installed react-split-pane in my application, but it does not seem to work.
I'm using react-split-pane version 0.1.68 but I tested it with 0.1.66 and 0.1.64 as well.
This is my component:
import React, { Component } from 'react';
import SplitPane from 'react-split-pane';
class Edit extends Component {
render() {
return (
<SplitPane split="vertical">
<div style={{backgroundColor: 'red'}}>LEFT</div>
<div style={{backgroundColor: 'blue'}}>RIGHT</div>
</SplitPane>
);
}
}
export default Edit;
I end up with a component that looks like I how styled it, but dragging between the elements to resize the width of the elements does not work.
What am I missing here?
Ps this issue might be related to it, but I tried previous versions and they don't seem to work either.
Split-Pane React component, can be nested or split vertically or horizontally! By dragging 'draggable' surface you can change size of the first pane. The first pane keeps then its size while the second pane is resized by browser window. By default it is the left pane for 'vertical' SplitPane and the top pane for 'horizontal' SplitPane.
Sortable and resizable pane component for react. The className property is used to set the css classname of a component. The style property is used to set the style of a component. The direction property is used to set the direction of a component. If omitted the default direction is 'horizontal'.
By dragging 'draggable' surface you can change size of the first pane. The first pane keeps then its size while the second pane is resized by browser window. By default it is the left pane for 'vertical' SplitPane and the top pane for 'horizontal' SplitPane.
That's a lot to fit on one screen, but I knew CodePen was already solving a similar design challenge with resizable split panels in their online code editor. The resizable panels are a simple concept that allows users to create more space for themselves by increasing or decreasing the size of panels using a draggable gutter.
I had a similar problem. The reason why divider doesn't work is: missing CSS
Add CSS from tutorial: https://github.com/tomkp/react-split-pane#example-styling to your react component. For example:
import './edit.css';
Your dragging element will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With