Slide 22
Slide 22 text
Nullable Property ͳΒͳ͠
export default class App extends Component<{}> {
componentDidMount() {
let adapter = NativeModules.RLDRootAdapter;
let languages = [
{ type: "Swift", stars: 41872 },
{ type: "Kotlin" }, <—————
]
adapter.emitChange(languages);
}
render() {
return ;
}
}
import Foundation
struct Language: Codable {
var type: String = ""
var stars: Int? = 0 <—————
}