You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add v2.x migration section to migration guide (#864)
Update the migration guide to include a dedicated section for v2.x users.
v2.x had a different API than v0.1.x (it already used Pane components with
initialSize prop), so each version needs its own migration instructions.
- Add "Migrating from v2.x" section with specific prop mappings
- Keep "Migrating from v0.1.x" section for older users
- Document key differences: initialSize→defaultSize, split→direction swap
- Update README.md and CHANGELOG.md references
Closes#863
This guide will help you migrate from react-split-pane v0.1.x to v3.0.0. Version 3 is a complete rewrite with modern React patterns, TypeScript support, and improved accessibility.
3
+
This guide will help you migrate to react-split-pane v3.0.0. Version 3 is a complete rewrite with modern React patterns, TypeScript support, and improved accessibility.
4
4
5
-
## Overview of Changes
5
+
## Migrating from v0.1.x
6
6
7
-
v3.0.0 introduces several breaking changes:
7
+
### Overview of Changes
8
+
9
+
v3.0.0 introduces several breaking changes from v0.1.x:
8
10
9
11
-**Component structure**: Children must be wrapped in `<Pane>` components
@@ -169,7 +171,7 @@ The `ResizeEvent` object includes:
169
171
-`source`: `'mouse'` | `'touch'` | `'keyboard'`
170
172
-`originalEvent`: The original DOM event
171
173
172
-
### 7. `primary` Prop Removed
174
+
####7. `primary` Prop Removed
173
175
174
176
The `primary` prop has been removed. In v3, sizes are distributed proportionally when the container resizes. For controlled sizing, use the `size` prop on each `<Pane>`:
175
177
@@ -190,7 +192,7 @@ function App() {
190
192
}
191
193
```
192
194
193
-
### 8. `allowResize` Renamed to `resizable`
195
+
####8. `allowResize` Renamed to `resizable`
194
196
195
197
```jsx
196
198
// v0.1.x
@@ -200,7 +202,7 @@ function App() {
200
202
<SplitPane resizable={false}>
201
203
```
202
204
203
-
### 9. `step` Prop
205
+
####9. `step` Prop
204
206
205
207
The `step` prop now applies to keyboard navigation. Use `snapPoints` for drag snapping:
206
208
@@ -216,17 +218,17 @@ The `step` prop now applies to keyboard navigation. Use `snapPoints` for drag sn
216
218
>
217
219
```
218
220
219
-
### 10. Styling Changes
221
+
####10. Styling Changes
220
222
221
-
#### CSS Class Names Changed
223
+
#####CSS Class Names Changed
222
224
223
225
| v0.1.x | v3 |
224
226
|--------|-----|
225
227
|`SplitPane`|`split-pane`|
226
228
|`Resizer`|`split-pane-divider`|
227
229
|`Pane1`, `Pane2`|`split-pane-pane`|
228
230
229
-
#### Inline Style Props Changed
231
+
#####Inline Style Props Changed
230
232
231
233
| v0.1.x | v3 |
232
234
|--------|-----|
@@ -262,7 +264,7 @@ The `step` prop now applies to keyboard navigation. Use `snapPoints` for drag sn
262
264
</SplitPane>
263
265
```
264
266
265
-
#### Custom Resizer → Custom Divider
267
+
#####Custom Resizer → Custom Divider
266
268
267
269
```jsx
268
270
// v0.1.x - CSS class customization
@@ -283,7 +285,7 @@ function CustomDivider(props) {
283
285
<SplitPane divider={CustomDivider}>
284
286
```
285
287
286
-
### 11. Persistence Pattern Updated
288
+
####11. Persistence Pattern Updated
287
289
288
290
```jsx
289
291
// v0.1.x
@@ -311,7 +313,7 @@ function App() {
311
313
}
312
314
```
313
315
314
-
### 12. Multiple Panes
316
+
####12. Multiple Panes
315
317
316
318
v3 supports 2+ panes natively (no nesting required):
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -345,7 +345,7 @@ A subtle single-pixel divider:
345
345
346
346
React Split Pane works seamlessly with Tailwind CSS and shadcn/ui. See [TAILWIND.md](./TAILWIND.md) for detailed integration examples including custom dividers and CSS variable overrides.
347
347
348
-
## Migration from v0.1.x
348
+
## Migration from v0.1.x or v2.x
349
349
350
350
See [MIGRATION.md](./MIGRATION.md) for detailed migration guide.
0 commit comments