Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
fix: pass props down to Epic
Browse files Browse the repository at this point in the history
fixes #2
  • Loading branch information
Alexey Yerin committed Sep 18, 2020
1 parent a87e621 commit f630872
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Epic.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useState, ReactNode, useMemo } from "react";
import { Epic, Tabbar, TabbarItem } from "@vkontakte/vkui";
import { EpicProps } from "@vkontakte/vkui/dist/components/Epic/Epic";
import { TabbarItemProps } from "@vkontakte/vkui/dist/components/TabbarItem/TabbarItem";

interface EpicProps {
interface NavigatorEpicProps extends Omit<EpicProps, "activeStory" | "tabbar"> {
/**
* Default story (`View` or `Root`'s ID)
*/
Expand Down Expand Up @@ -66,10 +67,11 @@ const buildTabbar = (
/**
* Wrapper around `Epic`
*/
const NavigatorEpic: React.FC<EpicProps> = ({
const NavigatorEpic: React.FC<NavigatorEpicProps> = ({
homeStory,
tabbar,
children,
...rest
}) => {
const [story, setStory] = useState(homeStory);

Expand All @@ -80,7 +82,7 @@ const NavigatorEpic: React.FC<EpicProps> = ({
]);

return (
<Epic activeStory={story} tabbar={builtTabbar}>
<Epic {...rest} activeStory={story} tabbar={builtTabbar}>
{children}
</Epic>
);
Expand Down

0 comments on commit f630872

Please sign in to comment.