What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-12 16:35:07
prism react renderer
jsximport React from 'react'import styled from 'styled-components'import { AiOutlineLike } from 'react-icons/ai' const LikeButton = () => { const [value, setValue] = React.useState(0) return ( <Wrapper> <div> <button onC... Add solution -
-
Other 2022-01-31 10:46:14
create global styles in styled components
import { createGlobalStyle } from 'styled-components' const GlobalStyle = createGlobalStyle` body { color: ${props => (props.whiteColor ? 'white' : 'black')}; } ` // later in your app <React.Fragment> <GlobalStyle whiteColor />... Add solution -
TypeScript 2022-01-26 05:31:20
react functional components modal
import React, { useEffect } from "react";import { createPortal } from "react-dom";import styled from "styled-components";import PropTypes from "prop-types"; const Portal = ({ children }) => { const modalRoot = ... Add solution -
Javascript 2022-01-22 08:10:08
how to spot Error: Maximum update depth exceeded. in react
import React, { Component } from 'react'; import styled from 'styled-components'; class Item extends React.Component { constructor(props) { super(props); this.toggle= this.toggle.bind(this); this.state = { det... Add solution -
Shell/Bash 2021-11-09 09:50:06
gatsby-plugin-styled-components
npm install --save gatsby-plugin-styled-components styled-components babel-plugin-styled-components # yarn yarn add gatsby-plugin-styled-components styled-components babel-plugin-styled-components # Edit gatsby-config.js module.exports = { plugins... Add solution