Skip to content

Instantly share code, notes, and snippets.

View rocksinghajay's full-sized avatar

Ajay singh rocksinghajay

View GitHub Profile
axios.post('https://api.sandbox.paypal.com/v1/oauth2/token', { grant_type: 'client_credentials' },
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': ` ` // your Authorization value you get from postman api hit
}
}
)
.then(response => {
console.log(response.data.access_token)
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import React from 'react';
const createClass = React.createClass {
state = {
title: "This is createClass component example"
}
render() {
const { title } = this.state
import React from 'react';
const stateLessFunctional = (props) => {
const onSubmitting = () => {
alert('This is stateless functional component example');
}
return(
<div>
import React from 'react';
const presentationalComponent = (props) => (
<div>
<h2>
This is a example of Presentational Component
</h2>
</div>
);
export default presentationalComponent;
import React from 'react';
class defaultComponent extends React.Component {
state = {
title: "This is default component class"
}
render() {
const { title } = this.state
import React, { Component } from 'react'
export default class Login extends Component {
state = {
email: '',
password: ''
};
handleOnChange = event => {
handleOnChange(event) {
console.log(event.target.name); // the name of the form element
console.log(event.target.value); // the value of the form element
}
const object = {}
object['key' + '10'] = 10
console.log(object.key10) // Outpu -> 10