Skip to content

Commit 5139dfa

Browse files
author
Jess
committed
Fixed error when inheriting from components with methods
1 parent 7eeaab5 commit 5139dfa

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/test/basic.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ describe('basic', () => {
3434
expect(() => styled.notExistTag``).toThrow()
3535
})
3636

37+
it('should allow for inheriting components that are not styled', () => {
38+
const componentConfig = { name: 'Parent', template: '<div><slot/></div>', methods: {} }
39+
expect(() => styled(componentConfig, {})``).toNotThrow()
40+
})
41+
3742
// it('should generate an empty tag once rendered', () => {
3843
// const Comp = styled.div``
3944
// const vm = new Vue(Comp).$mount()

src/utils/isStyledComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default function isStyledComponent (target) {
22
return target &&
33
target.methods &&
4-
typeof target.methods.generateAndInjectStyles() === 'string'
4+
typeof target.methods.generateAndInjectStyles === 'function'
55
}

0 commit comments

Comments
 (0)