| Property Wrapper | Purpose | Ownership | Lifetime | Ideal Use Case |
|---|---|---|---|---|
| @State | Local, private value type state for a single view. | View | View's lifetime | Simple UI state (toggles, text fields, counters) |
| @Binding | Two-way connection to a value owned by an ancestor view. | Ancestor View | Ancestor's state's lifetime | Passing mutable state to child/reusable components |
| ObservableObject | (Protocol) A class that can emit changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>method</key> | |
| <string>ad-hoc</string> | |
| </dict> | |
| </plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # app/build.gradle | |
| # | |
| apply plugin: "com.android.application" | |
| apply plugin: 'io.fabric' | |
| import com.android.build.OutputFile | |
| project.ext.react = [ | |
| entryFile: "index.js", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Optimizations | |
| 1. FlatList | |
| const VehicleItem = React.memo(({ item }) => ( | |
| <View style={{ height: ITEM_HEIGHT }}> | |
| <Card style={styles.card}> | |
| <Text style={styles.plate}>{item.plate}</Text> | |
| <Text>Status: {statusMap[item.status]}</Text> | |
| <Text style={[styles.battery, { color: getBatteryColor(item.battery) }]}> | |
| Battery: {item.battery}% |
OlderNewer