Skip to Main Content
React Projects
book

React Projects

by Roy Derks
December 2019
Intermediate to advanced content levelIntermediate to advanced
474 pages
10h 3m
English
Packt Publishing
Content preview from React Projects

Creating a basic animation

One of the simplest animations you can add is fading an element in or out by changing the value for the opacity of that element. In the Tic-Tac-Toe game you created previously, the slots were filled with either a green or blue color, depending on which player filled that slot. These colors already show a small transition since you're using the TouchableOpacity element to create the slot. However, it's possible to add a custom transition to this by using the Animated API. To add an animation, the following code blocks must be changed:

  1. Start by creating a new file in the src/Components/Slot directory and calling it Filled.js. This file will contain the following code, which will be used to construct the Filled component. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

React Projects - Second Edition

React Projects - Second Edition

Roy Derks
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781789954937Supplemental Content