UNPKG

rn-dynamic-ui-render

Version:
30 lines (25 loc) 702 B
import { View } from "react-native"; import { DynamicComponentView } from "../components"; import template from "../json/test.json"; import { useState } from "react"; export default function APP() { const [username, setUserName] = useState(" "); const [usernameVisible, setUserNameVisible] = useState(); const onChangeText = (value) => { setUserName(value); }; function onContinuePress() { setUserNameVisible(!usernameVisible); } const functions = { usernameVisible, username, onChangeText, onContinuePress, }; return ( <View> <DynamicComponentView data={template.content} functions={functions} /> </View> ); }