Skip to content

Commit

Permalink
Add text wrapping to migration guide (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Demedes authored Aug 9, 2020
1 parent 898f25b commit 8d8bbdb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,19 @@ const Example = () => {
return <Box ref={boxRef}>Hello World</Box>;
};
```

### Text is wrapped by default

Previously, [`<Box>`](https://github.com/vadimdemedes/ink/tree/v2.7.1#box) had a [`textWrap`](https://github.com/vadimdemedes/ink/tree/v2.7.1#textwrap) property, which would specify if and how text inside that element should be wrapped.
In Ink 3 all text is wrapped by default based on container's dimensions and `textWrap` property has moved to [`<Text>`](https://github.com/vadimdemedes/ink#text) component instead and is now named [`wrap`](https://github.com/vadimdemedes/ink#wrap).
It acceps the same values as before.

```jsx
// Before
<Box textWrap="wrap">Hello World</Box>
<Box textWrap="truncate">Hello World</Box>

// After
<Text>Hello World</Text>
<Text wrap="truncate">Hello World</Text>
```

0 comments on commit 8d8bbdb

Please sign in to comment.