Skip to content

Commit

Permalink
test bed to report values
Browse files Browse the repository at this point in the history
  • Loading branch information
hgray-instawork committed Dec 19, 2024
1 parent c118436 commit ff7d769
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/core/components/hv-route/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as NavigationContext from 'hyperview/src/contexts/navigation';
import * as NavigatorMapContext from 'hyperview/src/contexts/navigator-map';
import * as NavigatorService from 'hyperview/src/services/navigator';
import * as Render from 'hyperview/src/services/render';
import * as ScrollObserver from 'hyperview/src/services/scroll-observer';
import * as Stylesheets from 'hyperview/src/services/stylesheets';
import * as Types from './types';
import * as UrlService from 'hyperview/src/services/url';
Expand All @@ -21,6 +22,7 @@ import type {
ScreenState,
} from 'hyperview/src/types';
import React, { JSXElementConstructor, PureComponent, useContext } from 'react';
import { Text, View } from 'react-native';
import HvNavigator from 'hyperview/src/core/components/hv-navigator';
import HvScreen from 'hyperview/src/core/components/hv-screen';
import { LOCAL_NAME } from 'hyperview/src/types';
Expand Down Expand Up @@ -676,9 +678,19 @@ function HvRouteFC(props: Types.Props) {
}

export default function HvRoute(props: Types.Props) {
const scrollObserver = useContext(ScrollObserver.Context);
console.log('>>> route got:', scrollObserver.offsets);

return (
<BackBehaviorProvider>
<HvRouteFC navigation={props.navigation} route={props.route} />
<ScrollObserver.Context.Consumer>
{context => (
<View style={{ flex: 1 }}>
<Text>{`Route:${Object.keys(context.offsets)}`}</Text>
<HvRouteFC navigation={props.navigation} route={props.route} />
</View>
)}
</ScrollObserver.Context.Consumer>
</BackBehaviorProvider>
);
}
Expand Down

0 comments on commit ff7d769

Please sign in to comment.