The React way: let UI = ƒ(state)
Assume that our layers are predefined and return value of our render function needs to look like this:
let UI = {
layers: {
container: {| import React, { Component } from "react"; | |
| import "./App.css"; | |
| import ChecklistCombo from "./generated/components/ChecklistCombo"; | |
| import ChecklistCard from "./generated/components/ChecklistCard"; | |
| import ChecklistItemCard from "./generated/components/ChecklistItemCard"; | |
| function compareNodePosition(a, b) { | |
| if (!a || !b) return "implementation_specific"; |
| import React from "react"; | |
| function compareNodePosition(a, b) { | |
| if (!a || !b) return "none"; | |
| const documentPosition = a.compareDocumentPosition(b); | |
| if (documentPosition & Node.DOCUMENT_POSITION_CONTAINS) return "contains"; | |
| if (documentPosition & Node.DOCUMENT_POSITION_CONTAINED_BY) | |
| return "contained_by"; |
| { | |
| "types" : [ | |
| { | |
| "case" : "type", | |
| "data" : { | |
| "cases" : [ | |
| { | |
| "case" : "normal", | |
| "name" : "undefined", | |
| "params" : [ |
| { | |
| devices: [ | |
| { | |
| deviceId: 'iPhone SE', | |
| heightMode: 'At Least', | |
| }, | |
| { | |
| deviceId: 'iPhone 8', | |
| heightMode: 'At Least', | |
| }, |
| { | |
| "devices" : [ | |
| { | |
| "deviceId" : "iPhone SE", | |
| "heightMode" : "At Least" | |
| }, | |
| { | |
| "deviceId" : "iPhone 8", | |
| "heightMode" : "At Least" | |
| }, |
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <root> | |
| <devices> | |
| <device id="iPhone SE" heightMode="At Least"> | |
| <device id="iPhone 8" heightMode="At Least"> | |
| <device id="iPhone XS Max" heightMode="At Least"> | |
| </devices> | |
| <examples> | |
| <example id="Headline_only" name="Headline only"> |
| ({ | |
| devices: [ | |
| { | |
| deviceId: "iPhone SE", | |
| heightMode: "At Least" | |
| }, | |
| { | |
| deviceId: "iPhone 8", | |
| heightMode: "At Least" | |
| }, |
| import React from 'react'; | |
| import { StyleSheet, Text, View } from 'react-native'; | |
| export default function App() { | |
| return ( | |
| <View style={styles.container}> | |
| <Text>Let's change this line to see if it works!</Text> | |
| </View> | |
| ); | |
| } |
This is an example workspace for testing flat token generation.