Web Developer
I create really simple expo app just to get listing todos data from appwrite, its 100% fine when i build it in development profile, but when i try to build using preview profile, the app just blank, nothing showing.
Votes
0
Replies
1
Participants
Unknown
Messages
2
Web Developer
I create really simple expo app just to get listing todos data from appwrite, its 100% fine when i build it in development profile, but when i try to build using preview profile, the app just blank, nothing showing.
Web Developer
my code:
export default function Index() {
const [todos, setTodos] = useState([]);
useEffect(() => {
const fetchTodos = async () => {
const todos = await getTodos();
if(todos){
setTodos(todos);
}
}
fetchTodos();
}, []);
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center",
}}
>
Todos:
{todos.length > 0 ? (
todos.map((todo: any) => (
<TouchableOpacity key={todo.$id} style={{ padding: 10 }}>
{todo.title}
))
) : (
)}
</View>
);
}