File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,15 @@ describe('#styled', () => {
142142 const { container } = render ( < Dummy /> )
143143 expect ( container . firstChild ) . toHaveStyle ( 'color: red; margin: 4px;' )
144144 } )
145+
146+ it ( 'passes options through' , ( ) => {
147+ // https://emotion.sh/docs/styled#customizing-prop-forwarding
148+ const Dummy = styled ( 'div' , {
149+ shouldForwardProp : ( prop ) => prop !== 'color' ,
150+ } ) ``
151+ const { container } = render ( < Dummy color = "lemonchiffon" /> )
152+ expect ( container . firstChild ) . not . toHaveAttribute ( 'color' , 'lemonchiffon' )
153+ } )
145154} )
146155
147156describe ( '#styled.xxx' , ( ) => {
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ type BoxStyledTags = {
3333interface CreateXStyled extends CreateStyled , BoxStyledTags { }
3434
3535// @ts -ignore
36- export const styled : CreateXStyled = ( component : any ) => {
37- return getCreateStyle ( emStyled ( component ) )
36+ export const styled : CreateXStyled = ( component : any , options : any ) => {
37+ return getCreateStyle ( emStyled ( component , options ) )
3838}
3939
4040styled . box = styled ( x . div )
You can’t perform that action at this time.
0 commit comments