What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-20 19:13:02
use svg in react native
yarn add react-native-svg yarn add react-native-svg-uri npx react-native link react-native-svg ... import * as React from 'react'; import SvgUri from 'react-native-svg-uri'; // SVG Package import testSvg from './test.svg'; // SVG File ex... Add solution -
Javascript 2021-09-17 20:11:02
react convert excel to json
import React, { useState } from "react"; import "./App.css"; import * as XLSX from "xlsx"; class ExcelToJson extends React.Component { constructor(props) { super(props); this.handleClick = this.handleClick.bind(thi... Add solution -
TypeScript 2021-09-13 14:46:02
firestore cloud function update documents
import * as functions from 'firebase-functions'; import * as admin from 'firebase-admin'; admin.initializeApp(); export const resetCounter = functions.https.onRequest((req, res) => { const resetRef = admin.firestore() .collection('collection... Add solution -
Other 2021-09-13 10:30:01
nest decorator get request ip
import { createParamDecorator } from '@nestjs/common'; import * as requestIp from 'request-ip'; export const IpAddress = createParamDecorator((data, req) => { if (req.clientIp) return req.clientIp; return requestIp.getClientIp(req); // In case we... Add solution -
Javascript 2021-09-09 11:31:01
mockimplementation for setstate
import * as React from 'react'; describe('Some message', () => { const setState = jest.fn(); // eslint-disable-next-line @typescript-eslint/no-explicit-any const useStateMock: any = (initState: any) => [initState, setState]; afterE... Add solution -
Javascript 2021-09-08 23:25:01
how to make global variable in angular
Here is the simplest solution w/o Service nor Observer: Put the global variables in a file an export them. // // ===== File globals.ts // 'use strict'; export const sep='/'; export const version: string="22.2.2"; To use globals in ano... Add solution -
Javascript 2021-09-08 16:15:02
open modal on clicking select option in react
import * as React from 'react'; export class Demo extends React.Component<{}, {}> { state = { options: [ { text: 'doNothing', value: 'doNothing' }, { text: 'openModal', value: 'openModal' } ], open: false }; onClose =... Add solution