ohanhi / elm-native-ui

[CLOSED] Experiment: mobile apps in Elm using React Native.
BSD 3-Clause "New" or "Revised" License
1.54k stars 76 forks source link

Fixes for React Native 0.55 #98

Open nateabele opened 6 years ago

nateabele commented 6 years ago

Just got this up and running on React Native 0.55 and React 16. Outside of removing references to NavigationCardStack, NavigationHeader, and NavigationHeaderTitle, the only other change required (in my non-exhaustive test app, anyway) was this patch to makeComponent():

6086,6089c6086
<     return React.createClass({
<       getInitialState: function getInitialState() {
<         return {};
<       },
---
>     return class extends React.Component {
6091c6088,6089
<       onAppReady: onAppReady,
---
>       state = {};
>       onAppReady = onAppReady;
6093c6091
<       componentDidMount: function componentDidMount() {
---
>       componentDidMount() {
6100c6098
<           this.renderer
---
>           this.renderer.bind(this)
6106c6104
<       },
---
>       }
6108c6106
<       renderer: function renderer(onMessage, initialModel) {
---
>       renderer(onMessage, initialModel) {
6111,6112c6109,6110
<         return this.updateModel;
<       },
---
>         return this.updateModel.bind(this);
>       }
6114c6112
<       updateModel: function updateModel(model) {
---
>       updateModel(model) {
6116c6114
<       },
---
>       }
6118c6116
<       render: function render() {
---
>       render() {
6125c6123
<     });
---
>     };

Happy to submit a PR, but obviously this breaks the navigation demo. 😞 Let me know your thoughts. Thanks!

akavel commented 6 years ago

Uh oh!

I'm actually just now trying to revive https://github.com/opsb/elm-native-expo-counter

@nateabele I allowed myself to use your changes and merge them into https://github.com/akavel/elm-native-ui for use in https://github.com/akavel/elm-native-expo-counter. HUGE THANKS!!!