Closed geirman closed 7 years ago
hey @geirman,
I think you should use create-react-app
https://github.com/facebookincubator/create-react-app
This will save your time for all those build config and babel set up.
let me know if that works for you.
cheers bill
yeah, that would be the easy solution, but In this case I'm integrating this page with a non-react app. Do you know what's going on?
Sorry, i don't have experience building on non-react app 😢
I would build your photo gallery component with create react app, and build it. yarn build
and then just make it target your non-react app dom element.
ReactDOM.render(<PhotoGallery />, document.getElementById('id'));
I will eventually do something like that, but it's not so simple to merge the two deployment workflows. In the meantime, this is what I've got to work with. And it should in theory work precisely the same. Totally understand if you don't want to look into this, and I thank you for your time (and your contribution) regardless.
However, if you do take a look, it should be pretty simple... just unzip and run that page to verify the error. You may see the problem right away (fingers crossed).
Again, thanks!
ha, I did open up the file and take a look, in fact react-transition-group doesn't work as well.
you can try this following hack
<script> var exports = {}; </script>
on top of the file.
Nice hack, and thanks for taking a look but unfortunately that just gives me a different set of errors. Is that what you saw too? If that worked for you but not me, then I'm really confused.
sorry mate, can't figure it out. you may want to post the question on stack overflow?
Ok then, if that's the best you can do ;)
Seriously, appreciate your effort. I'll keep searching
I also had the same problem. It worked perfectly in create-react-app but not in other non react-app setup. Any solution for this?
hey @AmirinNS, i haven't spend too much time without using a build tool (eg. webpack hence create react app works)... i may take a look at it, once i am complete with incoming hooks.
I'm building a photo slideshow component, and I'd like to animate each photo in using variations of scale, translateX, translateY, and opacity. So your component looks perfect!
The page is created without a build pipeline, so I'm including your script using unpkg. I've worked through several errors already, but I'm stuck with these three errors. The page works without your animate library (sans animations of course) and now I'm not sure what the problem might be. Seems like it should all work.
Here's how I'm importing your library, pulling in
react-transition-group
as a dependency for your library.And here's how I'm using your library.
Here's the source of the entire file, just unzip the html page into a folder then run
python -m SimpleHTTPServer
in that folder to view it using a webserver... slideshow.html.zip