What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-07 06:38:03
react parameter value from query string
// As far as I know there are three methods you can do that. // Suppose an URL looks like this // http://www.google.com.au?token=123 // 1) use a third library called 'query-string'. import queryString from 'query-string' const value=queryString.parse(th... Add solution -
Javascript 2021-09-06 17:08:01
countdown timer in seconds react
import React from 'react' import { useState, useEffect } from 'react'; const Timer = (props:any) => { const {initialMinute = 0,initialSeconds = 0} = props; const [ minutes, setMinutes ] = useState(initialMinute); const [seconds, setSeconds... Add solution -
Javascript 2021-09-06 15:25:02
how to change mui ripple color
const styles = { buttonRipple: { color: "#f00" } }; const MyButton = props => ( <Button TouchRippleProps={{ classes: { root: props.classes.buttonRipple } }}>Click me</Button> ); export default withStyles(styles)(MyButton) Add solution -
Javascript 2021-09-06 12:04:02
stop playing music when page is closed react
import React, { useRef, useEffect } from 'react'; import waves from '../audio/waves.mp3'; const RockyCoast = (props) => { // the audio variable needs to be stored in a ref in order to access it across renders let audio = useRef(); // s... 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 -
Other 2021-09-05 20:28:01
react click outside class implementation
import React, { Component } from 'react'; import PropTypes from 'prop-types'; /** * Component that alerts if you click outside of it */ export default class OutsideAlerter extends Component { constructor(props) { super(props); this... Add solution -
Javascript 2021-09-05 15:18:02
react get input value on button click functional component
const input = props => { let textInput = React.createRef(); function handleClick() { console.log(textInput.current.value); } return ( <div> <input ref={textInput} placeholder="Type a message..." /> <div onC... Add solution
Best helpers
Ranking is empty