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

FlipMove not working in production environment #225

Open
Bryan1337 opened this issue Apr 19, 2018 · 7 comments
Open

FlipMove not working in production environment #225

Bryan1337 opened this issue Apr 19, 2018 · 7 comments

Comments

@Bryan1337
Copy link

While running tests locally with FlipMove everything seems to work perfectly. Though when deploying to a production environment, Flipmove seems to break the container it's supposed to render. The error I'm getting is:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of 't'

't' appears to be the parent where the child containing the FlipMove tags gets rendered in. I've identified this as a FlipMove issue since commenting out the tags works perfectly fine, just without animations.

The list is rendered in a parent component as:

<ListContainer messages={this.state.messages} />

ListContainer:

import FlipMove from 'react-flip-move';
import SingleMessage from './SingleMessage';`

class ListContainer extends React.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <FlipMove duration={250} easing="ease-out">
                {this.props.messages.map(message => (
                    <SingleMessage
                        key={message.id}
                        message={message}
                    />
                ))}
            </FlipMove> 
        )      
    }
}
export default ListContainer;

React version: ^15.4.2
Flipmove ^3.0.1

An answer or some clarification on this topic would be greatly appreciated. I've been searching for alternatives or a way to make this work in production for quite a while now but I just can't wrap my head around what's going wrong here. 😅

@tobilen
Copy link
Collaborator

tobilen commented Apr 20, 2018

Hey @Bryan1337,

looks like a flip-move issue indeed. Can you provide an enviroment in which to reproduce this issue? https://codesandbox.io/, github repo etc.?

@rhys-vdw
Copy link
Collaborator

I can confirm that we also have this issue in prod right now, except I'm getting the error message in development too. Strangely the animation works in dev. I was considering opening an issue for this too. I'll take a look on Monday and report back with any findings.

@Bryan1337
Copy link
Author

Hey guys, thanks for the answers.

Unfortunately I'm not able to reproduce this issue in a sandbox environment. It only seems to persist after deploying FlipMove to production (After minifying). As @rhys-vdw stated, the animations do seem to work in a dev environment for some reason.

@wa0x6e
Copy link

wa0x6e commented Apr 24, 2018

Not sure if related, but I am encountering an issue on production too, but not on development.

In my case, there are no error messages, everything work perfectly when adding elements to the list. But when removing element, the list does not update.

Same bug when I tried downgrading to v2

@joshwcomeau
Copy link
Owner

Well, this is confusing!

Will try and find some time to dig into this, but my schedule is pretty packed over the next couple weeks.

@rhys-vdw
Copy link
Collaborator

rhys-vdw commented May 8, 2018

I fixed the occurrence of this by using stateful components.

@joshwcomeau
Copy link
Owner

Ohh, yeah. React Flip Move doesn't support functional stateless components.

Weird that it only seems to happen in production :/ maybe we should add a development warning to catch it sooner.

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

No branches or pull requests

5 participants