import { StyleSheet, TextInput, View } from "react-native"; import { useState } from "react"; import Text from "@components/Text"; import Button from "@components/Button"; import { colors } from "@components/style"; export default function BeerAdd() { const [b_name, setBName] = useState(""); const [b_degree, setBDegree] = useState(""); const [b_packaging, setBPackaging] = useState(""); const [b_brand, setBBrand] = useState(""); async function addBeer() { const req = await fetch(`${process.env.EXPO_PUBLIC_API_URL}/beer/add`, { method: "POST", credentials: "include", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ brand: b_brand, name: b_name, degree: b_degree, packaging: b_packaging, photos: null, }), }); console.log(1, req); const res = await req.json(); console.log(2, res); } return ( setBName(text)} /> setBBrand(text)} /> setBDegree(text)} /> setBPackaging(text)} />