Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

Ionic 4 react enterAnimation

$
0
0

@divyanshugarg36 wrote:

Hi, I am making a IOS app using Ionic 4 and React. I want to animate my popover https://ionicframework.com/docs/api/popover using enterAnimation attribute, but couldn’t make it work. Can anyone please provide any example of popover animation with enterAnimation using Ionic 4 and React? There are some examples of the popover animation in Angular out there, but couldn’t find any React example.
Here’s my code

It would be helpfull if i can get a full example to use animations with this popover maybe update docs it will be much more helpfull

import React, { useState } from ‘react’;
import { IonPopover } from ‘@ionic/react’;

export const PopOver: React.FC = ({ children, showPopover, setShowPopover, popOverProps }) => {
const [popoverEvent, setPopoverEvent] = useState();
const button = children[0];
const content = children[1];
return (
<>
{React.cloneElement(button as React.ReactElement, {
onClick: (e: any) => {
e.persist();
setPopoverEvent(e);
setShowPopover(!showPopover);
}
})}
<IonPopover
mode=“ios”
animated
enterAnimation={(e: any) => { //what to do here? }}
isOpen={showPopover}
event={popoverEvent}
showBackdrop={false}
onDidDismiss={() => setShowPopover(false)}
{…popOverProps}
>
{content}

</>
);
};

PopOver.defaultProps = {
showPopover: false,
setShowPopover: () => { },
children: ,
popOverProps: {}
};

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles