February 21, 2020
In regular CSS you can give an element the property max-width: max-content
, which makes the element (at most) as wide as the text inside of it.
There's no direct equivalent in React Native, but instead you can use flexbox to emulate this behavior to make a Text
element only as wide as the text inside.
export default () => {
return (
<View
style={{
alignSelf: "flex-start"
}}
>
<Text>Hello, world!</Text>
</View>
)
}
Tufts Meal Plan Wrapped
Mar 2, 2024
Building an e-ink picture frame that displays an iCloud photo album
Jan 9, 2024
2023 in review
Jan 5, 2024
Subscribe to my newsletter for a monthly round-up of new blog posts and projects Iām working on!