I have installed animejs from npm , and imported the required file, but when adding anime(code) inside my code it does not work prefectly and shows an error .
this is a small example of what I did :
import React from 'react';
import anime from 'animejs';
const test =()=>{
const animation = anime({
targets: '.css-selector-demo .el',
translateX: 250
});
return(
<div>
{
animation
}
</div>
)
}
export default test;
and this is the error that I got :
Error: Objects are not valid as a React child (found: object with keys {update,
begin, loopBegin, changeBegin, change, changeComplete, loopComplete, complete, loop,
direction, autoplay, timelineOffset, id, children, animatables, animations,
duration, delay, endDelay, finished, reset, set, tick, seek, pause, play,
reverse, restart, passThrough, currentTime, progress, paused, began, loopBegan,
changeBegan, completed, changeCompleted, reversePlayback, reversed, remaining}).
If you meant to render a collection of children, use an array instead.