reapp / reapp-ui

Amazing cross platform UI's with React and JavaScript
https://reapp.io
MIT License
257 stars 47 forks source link

Uncaught TypeError: Cannot delete property 'styles' of #<Object> #90

Closed dantman closed 8 years ago

dantman commented 8 years ago

I'm getting this error when trying out the back button: Uncaught TypeError: Cannot delete property 'styles' of #<Object>

This comes from: https://github.com/reapp/reapp-ui/blob/7d9ac45c868bd14bac8aa3f949ce862f0d10577a/src/mixins/Styled.js#L37

And is likely related to the fact that React freezes objects passed to style.

dantman commented 8 years ago

Sorry, not related to React freezing style objects. It's probably the fact that props is not supposed to be modified and this is doing exactly that. ie: React likely freezes props.

dantman commented 8 years ago
'use strict';
import React from 'react';
import iOSTheme from 'reapp-ui/themes/ios/theme'
import Theme from 'reapp-ui/helpers/Theme';
import View from 'reapp-ui/views/View';
import BackButton from 'reapp-ui/components/buttons/BackButton';

const ApplicationView = ({title, children}) => (
    <Theme {...iOSTheme}>
        <View title={[<BackButton />, title||"asdf"]}>
            {children}
        </View>
    </Theme>
);

export default ApplicationView;
ryd0rz commented 8 years ago

This has been fixed with: https://github.com/reapp/reapp-ui/commit/c691659f7709c5e24cf793300c96f076ece76050