What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-29 21:43:02
dispay react component after some time
import React, { useState, useEffect } from 'react'; type Props = { children: React.ReactElement; waitBeforeShow?: number; }; const Delayed = ({ children, waitBeforeShow = 500 }: Props) => { const [isShown, setIsShown] = useState(false); useE... Add solution -
TypeScript 2021-09-29 10:10:04
react inherit html input props
import React from 'react'; interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { title: string; showIcon: boolean; } const Button: React.FC<ButtonProps> = ({ title, showIcon, ...props }) => { return ( <... Add solution -
TypeScript 2021-09-11 01:32:03
typescript ..otherProps
interface CustomComponentProps { prop1: string; prop2:string; } const CustomComponent: React.FC<CustomCompoenetProps & Record<string,any>> = ({prop1,prop2, ...otherProps}) => { retrun ( <> <Component prop1={... Add solution -
Javascript 2021-09-10 02:47:01
react iframe height
import React, { useState, useEffect, useCallback, RefObject } from "react"; import Frame from "react-frame-component"; interface FrameRef extends Frame { node: HTMLIFrameElement; } export const IFrame: React.FC = (props) => { ... Add solution -
Javascript 2021-09-05 22:07:02
react create list of array in react
const App = props => { const quoteArray = props.quotes.map((quote) => { return ( <Quote text={quote.text} author={quote.author} /> ); }); return ( <div> <h2>Famous Quotes</h2> {quoteArray} </d... Add solution -
Javascript 2021-08-31 17:29:02
Unable to resolve module `react/lib/ReactComponentWithPureRenderMixin` from `node_modules\react-navigation\src\views\Header.js`: react/lib/ReactComponentWithPureRenderMixin could not be found within the project
Unable to resolve module `react/lib/ReactComponentWithPureRenderMixin` from `node_modules\react-navigation\src\views\Header.js`: react/lib/ReactComponentWithPureRenderMixin could not be found within the project Add solution -
Javascript 2021-08-30 10:22:01
window.location.search get parameters react
import { useLocation } from 'react-router'; import queryString from 'query-string'; const Dashboard: React.FC = React.memo((props) => { const location = useLocation(); console.log(queryString.parse(location.search)); // {__firebase_reque... Add solution