rn-dynamic-ui-render
Version:
A dynamic UI rendering engine for React Native
30 lines (25 loc) • 702 B
JavaScript
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>
);
}