Skip to content

Instantly share code, notes, and snippets.

View mattgle's full-sized avatar
🥁
coding at 200 bpm

mattgle mattgle

🥁
coding at 200 bpm
  • RAILGUN Project
  • Buenos Aires, Argentina
  • 03:52 (UTC -03:00)
  • X @MatiasGrote
View GitHub Profile
@mattgle
mattgle / MercadoPagoCheckoutPro-ReactJS.ts
Last active October 2, 2021 23:59
Integracion de Mercadopago CheckoutPro en ReactJS [Sin usar FunctionComponents o ClassComponents]
export const redirectToMercadoPago = (transactionId: string) => {
const loadScript = (url: string, callback: () => void) => {
let script = document.createElement('script');
script.type = 'text/javascript';
if (script.readyState) {
script.onreadystatechange = () => {
if (
script.readyState === 'loaded' ||
script.readyState === 'complete'
import React, { useState, useEffect } from 'react';
import { View } from 'react-native';
import { VictoryPie } from 'victory-native';
import styles from './styles';
const graphicColor = ['#388087', '#6fb3b8', '#badfe7']; // Colors
const wantedGraphicData = [{ y: 10 }, { y: 50 }, { y: 40 }]; // Data that we want to display
const defaultGraphicData = [{ y: 0 }, { y: 0 }, { y: 100 }]; // Data used to make the animate prop work
import React from 'react';
import { View } from 'react-native';
import { VictoryPie } from 'victory-native';
import styles from './styles';
const graphicData = [{ y: 10 }, { y: 50 }, { y: 40 }];
const graphicColor = ['#388087', '#6fb3b8', '#badfe7'];
function Home() {
import React from 'react';
import { View } from 'react-native';
import { VictoryPie } from 'victory-native';
import styles from './styles';
const graphicData = [{ y: 10 }, { y: 50 }, { y: 40 }];
const graphicColor = ['#388087', '#6fb3b8', '#badfe7'];
function Home() {