Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Unrouted: React$ComponentType<{|
...ContextRouter,
someProp: string
|}> = () => <span>;
const Routed1: React$ComponentType<{| someProp: string |}> = withRouter(
Unrouted
);
// $ExpectError: This error bubbles up from the assignment in Routed2.
const Unrouted2: React$ComponentType<{|
...ContextRouter,
someProp: string
|}> = () => <span>;
const Routed2: React$ComponentType<{| someProp2: string |}> = withRouter(
Unrouted2
);
</span></span>
});
const match3: null | Match = matchPath("/the/pathname");
// $ExpectError
matchPath();
// $ExpectError
const matchError: string = matchPath("/the/pathname", {
path: "the/:dynamicId"
});
const Unrouted: React$ComponentType<{|
...ContextRouter,
someProp: string
|}> = () => <span>;
const Routed1: React$ComponentType<{| someProp: string |}> = withRouter(
Unrouted
);
// $ExpectError: This error bubbles up from the assignment in Routed2.
const Unrouted2: React$ComponentType<{|
...ContextRouter,
someProp: string
|}> = () => <span>;
const Routed2: React$ComponentType<{| someProp2: string |}> = withRouter(
Unrouted2
);
</span></span>
{
this.props.rightTextId ?
:
}
:
{/* nothing but counterbalance */}
}
;
}
}
export default withRouter(HeaderWithBack);
this.props.mutate({variables: {description, imageUrl}})
.then(() => {
this.props.router.replace('/')
})
}
}
const addMutation = gql`
mutation ($description: String!, $imageUrl: String!){
createPost(description: $description, imageUrl: $imageUrl) {
id
}
}
`
const PageWithMutation = graphql(addMutation)(withRouter(CreatePage))
export default PageWithMutation
callback: () => Linking.openURL('https://github.com/jaywcjlove/awesome-mac'),
}
]);
}
render() {
return (
);
}
}
const RoutersContainer = withRouter(({ history: historyData, location }) => {
const routerData = getRouterData();
const BasicLayout = routerData['/'].component;
const resetProps = {
routerData,
location,
history: historyData,
};
return (
);
});
;
}
}
export default withRouter(connectPropsAndActions(ArticleItem));
interface IStates {}
class NavLink extends React.Component {
render(): any {
return
;
}
}
export default withRouter(NavLink);
/>
<footer>
Sign In
</footer>
)
}
}
export default withRouter(SignUp)
renderTitle={renderTitle}
renderLeftSegment={renderLeftSegment}
renderRightSegment={renderRightSegment}
animationType={animationType}
gestureEnabled={gestureEnabled}
children={children}
stackViewStyle={stackViewStyle}
replaceTransitionType={replaceTransitionType}
isAnimating={isAnimating}
/>
);
}
}
export default withRouter(Stack);
{/* }/>*/}
{/* }/>*/}
{/* }/>*/}
}/>
{/* }/>*/}
)
}
App.propTypes = {
history: PropTypes.shape({
push: PropTypes.func.isRequired
}).isRequired
}
export default withRouter(App)