import Taro from "@tarojs/taro";
import { useNavigation } from '@react-navigation/native';

//https://stackoverflow.com/questions/68779417/navigation-navigatehome-showing-some-error-in-typescript
export default function pushPage(url: string) {
    if (process.env.TARO_ENV === 'rn') {
        const navigation = useNavigation();
        navigation.navigate(url);
        /*
        navigation.navigate('Home', {
  screen: 'Feed',
  params: { sort: 'latest' },
});
        */
    }
    else {
        Taro.navigateTo({
            url: url
        })
    }
}