threepointone / glamor

inline css for react et al
MIT License
3.66k stars 199 forks source link

Typescript error: Property 'keyframes' does not exist on type 'typeof css'. #332

Open jakeleboeuf opened 7 years ago

jakeleboeuf commented 7 years ago

I'm new to typescript (and react!), so maybe I'm just doing something wrong? But getting the following error:

error TS2339: Property 'keyframes' does not exist on type 'typeof css'.

import { css } from 'glamor';

const bounce = css.keyframes({
  '0%': { transform: `scale(1.02)` },
  '100%': { transform: `scale(0.98)` }
});

Using glamor@2.20.40

threepointone commented 7 years ago

I have a fix in master, will release over the weekend. sorry!

jakeleboeuf commented 7 years ago

Woooooop! Thanks!!

ktranada commented 7 years ago

Any update on when the fix will be merged in?

getnorthern commented 7 years ago

I'm getting this too - any news on the fix, please?

russpate commented 6 years ago

got this error too -- is there a fix?

jakeleboeuf commented 6 years ago

For anybody who needs a quick fix, this should hold you over until @threepointone's fix is release.

const cssShim: any = css;

const animateScale = cssShim.keyframes({
  '0%': { transform: 'scale(1)' },
  '50%': { transform: 'scale(1.0125)' },
  '100%': { transform: 'scale(1)' }
});

const AnimatedDiv = glamorous.div({
  animation: `${animateScale} 2.5s ease-in-out infinite`
});
RoystonS commented 6 years ago

Hi @threepointone. Do you know when this might make it into a release?

It's all there in master since September 2017, but it hasn't made it into a npm release yet. Thanks!