We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you give me the example of a function component? I don't use class components. So what can I do? If I want to use meteor subscribe I use like that
import React, { useState } from "react"; import { View, Text } from "react-native"; import { Container, Header, Content, Form, Item, Input, Label, Button, Text } from "native-base"; // meteor import Meteor, { withTracker, MeteorListView } from "react-native-meteor"; Meteor.connect("ws://192.168.1.100:3000/websocket"); //do this only once let f = { name: "Bona", age: 20 }; export default () => { const [form, setForm] = useState(f); function btnRegister() { let doc = { name: form.name, age: Number(form.age) }; Meteor.call("insertCustomer", doc, (err, result) => { if (result) { console.log("inserted", result); } else { console.log("err", err); } }); } return ( <Container> <Header /> <Content> <Form> <Item fixedLabel> <Label>Username</Label> <Input value={form.name.toString()} onChangeText={value => setForm({ ...form, name: value })} /> </Item> <Item fixedLabel last> <Label>Age</Label> <Input keyboardType="number-pad" value={form.age.toLocaleString()} onChangeText={value => setForm({ ...form, age: value })} /> </Item> <Item> <Button onPress={btnRegister}> <Text>Register</Text> </Button> </Item> </Form> </Content> </Container> ); };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Can you give me the example of a function component?
I don't use class components.
So what can I do? If I want to use meteor subscribe
I use like that
The text was updated successfully, but these errors were encountered: