Using the CreateAnimation Wrapper Component in an Ionic

Using the CreateAnimation Wrapper Component in an Ionic

In this tutorial, we will be covering how to use the CreateAnimation wrapper component and the standard createAnimation method to create animations in an Ionic and React application

I’ve been working on a lot of animations with React and the Ionic Animations API as I create the React edition for Advanced Animations & Interactions with Ionic (which will be out sometime around October 2020 for those interested).

I already have a bit of content on the blog and my YouTube channel covering the basics of using the Ionic Animations API, but using it in an Ionic/React application is a little different to the usual experience. So, I wanted to create this tutorial to highlight the various ways you can create animations in React applications using the Ionic Animations API.

Throughout this tutorial, we will be building this simple animation two different ways:

One animation uses the <CreateAnimation> wrapper that the @ionic/react package provides, and the other animation uses the createAnimation method directly (which any framework can make use of an is available through @ionic/core). As you can probably tell, they both have the exact same result. The full source code for this tutorial will be available at the bottom of the page.

If you need more general context about the Ionic Animations API before we begin, I would recommend watching this video first: The Ionic Animations API.

The createAnimation Method

The main focus of this tutorial will be on creating an animation with the CreateAnimation component since it is React specific, but for context, let’s also cover the “normal” method for creating animations with the Ionic Animations API. If you prefer this method, there is no need to use the CreateAnimation component at all.

To create the animation shown above, we would first import createAnimation from @ionic/react:

import { createAnimation } from "@ionic/react";

react

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

What are hooks in React JS? - INFO AT ONE

In this article, you will learn what are hooks in React JS? and when to use react hooks? Also, we will see the react hooks example.

Build a simple React Native Pokemon app with React-Navigation

As we start learning new technologies we want to start building something or work on a simple project to get a better understanding of the technology.

Share Code Between React Native and React JS

React provides support for the server-side and frontend. Today, React development services are in demand as more and more organizations are considering software solutions that are crafted from the framework.

Validating React Forms With React-Hook-Form

In this article we will learn how to Validating React Forms With React-Hook-Form . Validating inputs is very often required. For example, when you want to make sure two passwords inputs are the same, an email input should in fact be an email or that the input is not too long