Skip to content

Commit 66da82f

Browse files
feat(views): change type to config on views and add components docs
BREAKING CHANGE: use typeof config instead of typeof app
1 parent e3befd0 commit 66da82f

File tree

9 files changed

+36
-592
lines changed

9 files changed

+36
-592
lines changed

packages/node_modules/overmind-components/src/Component.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ describe('COMPONENT', () => {
9191
</div>
9292
)
9393

94-
expect(test.getUpdates().length).toBe(3)
94+
console.log(test.getUpdates())
95+
expect(test.getUpdates().length).toBe(2)
9596

9697
expect(target.children[0].children[0].vtree).toBeInstanceOf(Null)
9798
})

packages/node_modules/overmind-components/src/Component.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { Null } from './Null'
2-
import { BaseApp } from 'overmind'
2+
import { TApp, Configuration } from 'overmind'
33

4-
export type TComponent<App extends BaseApp, Props = {}, Children = any> = (
4+
export type TComponent<
5+
Config extends Configuration,
6+
Props = {},
7+
Children = any
8+
> = (
59
props: {
6-
state: App['state']
7-
actions: App['actions']
10+
state: TApp<Config>['state']
11+
actions: TApp<Config>['actions']
812
children?: Children
913
} & Props
1014
) => any

packages/node_modules/overmind-components/src/hooks.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('HOOKS', () => {
129129
}
130130
testRender(app, <TestComponent />)
131131

132-
expect(providedRef.target.tag).toBe('div')
132+
expect(providedRef.current.tag).toBe('div')
133133
})
134134
})
135135
})

0 commit comments

Comments
 (0)