What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-07 07:10:24
how to set dynamic autocomplete with material ui
import React, { useState } from 'react'; using useState: const [val,setVal]=useState({}) changin value on click of button const handleClick = () => { setVal(top100Films[0]);//you pass any value from the array of top100Films // set value ... Add solution -
Other 2022-02-07 00:05:17
how-to-open-sweetalert-popup-on-button-click-in-reactjs
npm install sweetalert2-react ////////////////////////////////////////////////////////// import React from 'react'; import './App.css'; import Swal from 'sweetalert2' class App extends React.Component { opensweetalert = () => { Swal.fire... Add solution -
Other 2022-02-06 20:15:09
How to fix 'Could not find the drag and drop manager in the context of DragSource(Component)'
import React, { Component } from "react"; // import ReactDOM from "react-dom"; import HTML5Backend from "react-dnd-html5-backend"; import { DragDropContext as dragDropContext } from "react-dnd"; import DragBox from ... Add solution -
Javascript 2022-02-02 22:06:52
react route
import React, { Component } from 'react'; import { render } from 'react-dom'; import { BrowserRouter, Route, Switch, Link } from 'react-router-dom'; import { Home } from 'wherever-you-put-it/home.component.jsx'; import { Something } from 'wherever-you-put... Add solution -
Javascript 2022-02-02 19:51:32
select everything but an element in react
import reactDom from "react-dom"; import history from "../history"; const Modal = () => { return reactDom.createPortal( <div onClick={() => history.push("/")} className="ui dimmer modals visib... Add solution -
Javascript 2022-02-02 19:45:39
react hook example
// Hooks let you build stateful and dynamic components import React, { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0); return ( <div> ... Add solution -
Javascript 2022-02-02 18:46:44
rewrite src/App.js
// frontend/src/App.js import React, { Component } from "react"; import { BrowserRouter, Route, Switch } from "react-router-dom"; import Home from "./components/Home"; class App extends Component { render() { return ( ... Add solution -
Javascript 2022-02-02 11:26:06
material ui change button to custom color
/* style={{backgroundColor: '#12824C', color: '#FFFFFF'}} backgroundColor changes the button color color changes the text color These examples use Hex to define the color (Green button with white text) */ // Example import React from 'react'; import Bu... Add solution