mrzachnugent / react-native-reusables

Universal shadcn/ui for React Native featuring a focused collection of components - Crafted with NativeWind v4 and accessibility in mind.
https://rnr-docs.vercel.app
MIT License
3.12k stars 129 forks source link

[ BUG ] : Tabs are not getting displayed. #178

Closed dhruvwill closed 2 months ago

dhruvwill commented 2 months ago

Describe the bug Even the simplest implementation from the rnr docs website, doesn't render tabs. Nothing is getting rendered. using Tabs element.

To Reproduce simply Initialize an expo project. add tabs use tabs in page.

Expected behavior It should display tabs.

Platform (please complete the following information):

import { useState } from "react";
import { ScrollView } from "react-native";
import { View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { Separator } from "~/components/ui/separator";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/components/ui/tabs";
import { Text } from "~/components/ui/text";
import { Label } from "~/components/ui/label";
import { RefreshControl } from "react-native";

const m_followUpList = () => {
  const [refreshing, setRefreshing] = useState(false);
  const [list, setList] = useState("inquiry");
  const onRefresh = () => {
    setRefreshing(true);
    setTimeout(() => {
      setRefreshing(false);
    }, 2000);
  };
  return (
    <ScrollView
      keyboardShouldPersistTaps="handled"
      refreshControl={
        <RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
      }
    >
      <View className="flex mx-3 my-5">
        <View className="px-3">
          <Text className="text-3xl font-acumin_bold">List of Follow ups</Text>
          <Text className="text-muted text-sm font-acumin">
            Add a Follow up
          </Text>
          <Separator className="my-5 bg-gray-500" orientation="horizontal" />
        </View>
        <Tabs
          value={list}
          onValueChange={setList}
          className="w-full max-w-[400px] flex-col gap-1.5"
        >
          <TabsList className="flex-row w-full">
            <TabsTrigger value="inquiry" className="flex-1">
              <Text>Inquiry</Text>
            </TabsTrigger>
            <TabsTrigger value="quotation" className="flex-1">
              <Text>Quotation</Text>
            </TabsTrigger>
          </TabsList>
          <TabsContent value="inquiry">
            <Text> List of Inquiry Follow-ups</Text>
          </TabsContent>
          <TabsContent value="quotation">
            <Text>List of Quotation Follow-ups</Text>
          </TabsContent>
        </Tabs>
      </View>
    </ScrollView>
  );
};

export default m_followUpList;
mrzachnugent commented 2 months ago

Hey @dhruvwill , I am unable to reproduce this issue. Here is a screenshot from the code you provided.

Screenshot 2024-07-14 at 1 04 19 PM

If you are still having this issue, please open a new issue with a minimal reproduction repo.