SHARE
TWEET

Untitled

a guest Jun 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { css } from "@emotion/core";
  2. import React from "react";
  3.  
  4. checkNegative = counter => {
  5.   if (counter) {
  6.     return css`
  7.       background: green;
  8.     `;
  9.   }
  10. };
  11.  
  12. class Component extends React.Component {
  13.   state = { counter: -1 };
  14.   render() {
  15.     return <div css={checkNegative(this.state.counter)}>some text</div>;
  16.   }
  17. }
  18.  
  19. export default Component;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top