What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-01 06:25:09
getting view height dynamically in react native
import React, { Component } from 'react'; import ReactNative, { AppRegistry, View, TouchableOpacity, findNodeHandle, Text, StyleSheet } from 'react-native'; export default class App extends Component { constructor() { super(); this.state = {... Add solution -
Javascript 2022-02-28 15:15:06
lerp javascript
export function lerp(v0, v1, amt, maxMove = 0, minDiff = 0.0001) { let diff = v1 - v0; if (maxMove > 0) { diff = Math.min(diff, maxMove); diff = Math.max(diff, -maxMove); } if (Math.abs(diff) < minDiff) { return v1; } return v0 + diff * ... Add solution -
CSS 2022-02-25 04:25:06
how to use css in material ui
import React from 'react'; import Button from '@material-ui/core/Button'; import './PlainCssButton.css'; export default function PlainCssButton() { return ( <div> <Button>Default</Button> <Button className="but... Add solution -
Other 2022-02-24 09:20:04
method in vue component
<template> <div id="example"> <button v-on:click="greet">Greet</button> </div> </template> <script> export default { methods: { greet: function(event) { // `event` is the n... Add solution -
Javascript 2022-02-22 10:10:12
use context for arrays react
==App.js======================================== import React from 'react'; import PageContextProvider from './PageContextProvider'; import Header from './Header'; function App() { return ( <div className="App"> <... Add solution -
TypeScript 2022-02-20 03:10:16
typescript class import csv file
// # csv file import csvData from './latlong.csv'; //# text import import textData from '../common/text/info.txt'; //# json import import jsonData from '../common/json/jsondata.json'; export const TextResource = textData; // not-work export const JsonRe... Add solution -
Javascript 2022-02-20 02:40:36
how to pause useState counter value react hoooks
import React, { useState, useEffect } from 'react'; const Timer = () => { const [seconds, setSeconds] = useState(0); const [isActive, setIsActive] = useState(false); function toggle() { setIsActive(!isActive); } function reset() { ... Add solution -
Javascript 2022-02-18 07:35:24
how to pass argument in onFinish method in antdesign
import React from 'react'; import { Form, Input, Button } from 'antd'; const FormItem = Form.Item; class CustomForm extends React.Component { handleFormSubmit = (values) => { const title = values.title; const content = values.content; ... Add solution -
Other 2022-02-17 17:00:03
componentdidmount functional hook
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