Skip to content

Instantly share code, notes, and snippets.

View nasliedkov's full-sized avatar

Stepan Nasliedkov nasliedkov

View GitHub Profile
@nasliedkov
nasliedkov / Text.tsx
Last active December 20, 2022 12:56
RN - text wrap
<View style={{flex: 1}}>
<Text style={{flexShrink: 1}}> You miss fdddddd dddddddd
You miss fdd
</Text>
</View>
@nasliedkov
nasliedkov / conditional.js
Last active February 4, 2022 15:15
conditional object field
const condition = true
const conditionalField = { ...(condition && { key: 'value' }) };
const conditionalArrayItem = [...(condition) ? ['value'] : []]
const ConditionalWrapper = ({ condition, wrapper, children }) =>
condition ? wrapper(children) : children;