What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-03 12:39:02
communication child to parent react js
import React from 'react'; import Child from './Child' export default class Parent extends React.Component { constructor(props){ super(props); th... Add solution -
Javascript 2021-09-03 00:30:01
react ezyme simulate click
// App.js function App() { const [count, setCount] = React.useState(0) const onClick = () => { setCount((prevState) => prevState + 1) } return ( <div> <button onClick={onClick}>{count}</button> </div&... Add solution -
Javascript 2021-09-02 23:28:01
handle onchange react
import React, { Component } from 'react'; import './App.css'; import Header from './Header'; class App extends Component { constructor(props) { super(props); this.state = {name: "Michael"} } changeTitle = (e) =>{ this.... Add solution -
Javascript 2021-09-02 16:35:02
npm google map api react
import {Map, InfoWindow, Marker, GoogleApiWrapper} from 'google-maps-react'; export class MapContainer extends Component { render() { return ( <Map google={this.props.google} zoom={14}> <Marker onClick={this.onMarkerClick} ... Add solution -
Javascript 2021-09-02 15:50:02
create dynamic fields in react
import React, { useState } from "react"; function App() { const [inputList, setInputList] = useState([{ firstName: "", lastName: "" }]); // handle input change const handleInputChange = (e, index) => { const { ... Add solution -
CSS 2021-09-02 04:13:02
button material ui
// Check out my online sandbox to see more button props // https://codesandbox.io/s/material-ui-button-e809z?file=/src/App.js import React from 'react'; import Button from '@material-ui/core/Button'; export default function MaterialuiButton() { fun... Add solution -
Javascript 2021-09-01 13:34:03
localStorage is not defined NextJS
// components function Storage(props) { const LocalStorage = ({ type, keys, value, onLocalStorage }) => { switch (type) { case 'set': keys !== undefined && window.localStorage.setItem(keys, value) break case 'get': keys !==... Add solution -
Javascript 2021-09-01 06:32:01
react detect screen size
import { useState, useEffect } from 'react'; function getWindowDimensions() { const { innerWidth: width, innerHeight: height } = window; return { width, height }; } export default function useWindowDimensions() { const [windowDimensions,... Add solution
Best helpers
Ranking is empty