4 ms·
Curious to hear more about what SwiftUI does better than React… any place I can read more?
by sophiebits 6y ago
Curious to hear more about what SwiftUI does better than React… any place I can read more?
- doteka 6y agoThe official Apple tutorial gives you an idea what they were going for, but in practice it’s nowhere near that smooth. In fact, most of the time I found myself staring at a “type too complex, add annotation” error. That one doesn’t actually mean your type is too complex, it just means you’re passing the wrong thing somewhere and instead of a useful error message the compiler just gave up and broke.
- kitsunesoba 6y agoErrors in SwiftUI are significantly better in the recently released Swift 5.2, so this is clearly something they’re working on.
- doteka 6y agoI certainly hope so, because this was definitely on Swift 5.2 . In general if you come in expecting a dev experience anywhere close to writing React in Typescript using VSCode, SwiftUI and Xcode both are a bit of a disappointment - it's slow, it's glitchy, autocomplete kind of sucks, never mind tooling like Prettier which I take for granted now.
- Diesel555 6y agoSorry for the late reply. You can change state without all the annoying purely functional programming stuff ([... previousState, newValue]). Just change it. You can change a prop passed in and even pass a new value up to the parent. So you know the pass a function down so the child can change a value in the parent? Just pass the variable you want changed down with @binding.