react-transitions icon indicating copy to clipboard operation
react-transitions copied to clipboard

centering children?

Open kraegpoeth opened this issue 7 years ago • 2 comments

Any way to center animated children? Tried with margin: auto on ReactTransistions and parent element, but it does not work...

kraegpoeth avatar Mar 10 '17 17:03 kraegpoeth

I found a workaround: Go to node_modules>react-transitions>dist>index.js and remove or comment out line position: 'absolute', under childWrapperStyle.

Edit: removing inline-block helps too. Edit2: previous workaround causes problems that next page does not 'push' previous away. Better solution is to add left:0,top:0 to childWrapperStyle and to _react2.default.createElement(..) (around 90th line)

MikeDabrowski avatar Mar 11 '17 14:03 MikeDabrowski

Would you show some snippets so that I could try to help out? On the demo page there is a text block, a "Hi, there" string, being centered. Giving a look at its source may help.

Feel free to let me know how it works out!

szchenghuang avatar Mar 13 '17 03:03 szchenghuang