Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please avoid json.stringify #803

Closed
smmoosavi opened this issue Apr 30, 2017 · 1 comment · Fixed by #886
Closed

Please avoid json.stringify #803

smmoosavi opened this issue Apr 30, 2017 · 1 comment · Fixed by #886
Assignees
Labels

Comments

@smmoosavi
Copy link
Contributor

in ScrollableTabBar.componentWillReceiveProps method JSON.stringify used which cause slow rendering and some times error thrown from this line.

react-native, react and native-base version

[email protected]
[email protected]
[email protected]

Steps to reproduce (code snippet or screenshot)

you can't run advanced tab example and you will see TypeError: Converting circular structure to JSON

                <Tab heading={ <TabHeading><Icon name="camera" /><Text>Camera</Text></TabHeading>}>
                    <Tab1 />
                </Tab>

Is the bug present in both ios and android or in any one of them?

I checked android

Any other additional info which would help us debug the issue quicker.

bad code:

    if (JSON.stringify(this.props.tabs) !== JSON.stringify(nextProps.tabs) && this.state._containerWidth) {
      this.setState({ _containerWidth: null, });
    }

if (JSON.stringify(this.props.tabs) !== JSON.stringify(nextProps.tabs) && this.state._containerWidth) {

@ishsingh
Copy link

ishsingh commented May 5, 2017

I have the same problem with following versions:

[email protected]
[email protected]
[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants