Today I learned Dec/16

Element implicitly has an ‘any’ type because expression of type ‘TransitionStatus’ can’t be used to index type ‘{ entering: { opacity: number; }; entered: { opacity: number; }; exiting: { opacity: number; }; exited: { opacity: number; }; }’.

Property ‘unmounted’ does not exist on type ‘{ entering: { opacity: number; }; entered: { opacity: number; }; exiting: { opacity: number; }; exited: { opacity: number; }; }’.ts(7053)

This error was received after copying from react transition group. It seemed there was something wrong with the type not matching.

A cursory look online revealed this

const transitionStyles: { [key: string]: React.CSSProperties } = {

was a solution. The output value was registering as only the things in the object but it could be a lot more. Switching React.CSSProperties to ‘any’ also theoretically works

entering: { opacity: 1 },

entered: { opacity: 1 },

exiting: { opacity: 0 },

exited: { opacity: 0 },

};

transitionStyles needed to have the output values be defined

Typescript is also interesting. It is important to know that when something is required, ever object that features it becomes required. Neat.

--

--

--

Starting a tech bootcamp

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to create Interactive Maps in React.js

8 JAVASCRIPT ARRAY Methods for Beginner

Clone Minesweeper in 15 minutes with TypeScript, React, and Redux

Everything You Need to Know about the Angular Framework and TypeScript

Crouching Tiger, Hidden Search Bar

OOP In JavaScript

GSoC 2020 with SCoRe Lab — Week 11

React Native: The Basics

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jesse Chung

Jesse Chung

Starting a tech bootcamp

More from Medium

My New Super Dev Journey

Top 5 Principles to Become a Trusted Advisor

The Trusted Advisor

What’s on the horizon for UK immigration in 2022?

How to Cook? Coriander. Do you have Cilantrophobia?

How to Cook? Coriander. Do you have Cilantrophobia?