recharts / react-smooth

react animation
MIT License
277 stars 38 forks source link

Not working at all #11

Closed rico345100 closed 7 years ago

rico345100 commented 7 years ago

I tried exactly same as Example, but it fails with:

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of `AnimatedComponent`.

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of `AnimatedComponent`.

This is the code:

import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import { Animate } from 'react-smooth';

const steps = [
{
    style: {
        opacity: 0,
    },
    duration: 400,
}, 
{
    style: {
        opacity: 1,
        transform: 'translate(0, 0)',
    },
    duration: 1000,
}, 
{
    style: {
        transform: 'translate(100px, 100px)',
    },
    duration: 1200,
}];

class AnimatedComponent extends React.Component {
    render() {
        return (
            <Animate steps={steps}>
                <h1>Animate!</h1>
            </Animate>
        );
    }
}

ReactDOM.render(
    <AnimatedComponent />,
document.getElementById('entry'));

Using React 15.4 with Browserify 13.3.0 and react-smooth 0.1.20. How can I solve this?

jasonHzq commented 7 years ago

react-smooth export default Animate~

import Animate from 'react-smooth';