@@ -49,7 +49,7 @@ function runTestSuite(mode: "observer" | "useObserver") {
49
49
list : 0
50
50
}
51
51
52
- const TodoItem = obsComponent ( ( { todo } : { todo : typeof store . todos [ 0 ] } ) => {
52
+ const TodoItem = obsComponent ( ( { todo } : { todo : ( typeof store . todos ) [ 0 ] } ) => {
53
53
renderings . item ++
54
54
return < li > |{ todo . title } </ li >
55
55
} , true )
@@ -997,38 +997,6 @@ it("dependencies should not become temporarily unobserved", async () => {
997
997
expect ( doubleDisposed ) . toBeCalledTimes ( 1 )
998
998
} )
999
999
1000
- it ( "Legacy context support" , ( ) => {
1001
- const contextKey = "key"
1002
- const contextValue = "value"
1003
-
1004
- function ContextConsumer ( _ , context ) {
1005
- expect ( context [ contextKey ] ) . toBe ( contextValue )
1006
- return null
1007
- }
1008
-
1009
- ContextConsumer . contextTypes = {
1010
- [ contextKey ] : ( ) => null
1011
- }
1012
-
1013
- const ObserverContextConsumer = observer ( ContextConsumer )
1014
-
1015
- class ContextProvider extends React . Component {
1016
- getChildContext ( ) {
1017
- return { [ contextKey ] : contextValue }
1018
- }
1019
-
1020
- render ( ) {
1021
- return < ObserverContextConsumer />
1022
- }
1023
- }
1024
-
1025
- ; ( ContextProvider as any ) . childContextTypes = {
1026
- [ contextKey ] : ( ) => null
1027
- }
1028
-
1029
- render ( < ContextProvider /> )
1030
- } )
1031
-
1032
1000
it ( "Throw when trying to set contextType on observer" , ( ) => {
1033
1001
const NamedObserver = observer ( function TestCmp ( ) {
1034
1002
return null
0 commit comments