Skip to content

Commit

Permalink
refactor: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
sparten11740 committed Oct 23, 2024
1 parent 2c42e56 commit 518db3a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/index.type-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ const extendedWithLinear = Object.assign(extendedStyled, {
})
})

const DefaultLinearGradient = extendedWithLinear.LinearGradient({ }).attrs({
colors: ['red', 'white'],
const DangerGradient = styled(LinearGradient)().attrs({ colors: ['orange', 'red']})
const DefaultGradient = extendedWithLinear.LinearGradient({ }).attrs({
colors: ['blue', 'green'],
})

const DangerLinearGradient = styled(LinearGradient)({}).attrs({ colors: ['orange', 'red']})

const MyScreen = () => {
const ref = useRef()
return (
Expand Down Expand Up @@ -85,10 +84,10 @@ const MyScreen = () => {
{/* @ts-expect-error -- missing "colors" */}
<LinearGradient/>
{/* doesn't require optional props */}
<DefaultLinearGradient />
<DangerLinearGradient />
<DefaultGradient />
<DangerGradient />
{/* but they can be provided */}
<DefaultLinearGradient colors={['blue', 'green']} />
<DefaultGradient colors={['blue', 'green']} />
</>
)
}

0 comments on commit 518db3a

Please sign in to comment.