This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| const createClass = React.createClass { | |
| state = { | |
| title: "This is createClass component example" | |
| } | |
| render() { | |
| const { title } = this.state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| const stateLessFunctional = (props) => { | |
| const onSubmitting = () => { | |
| alert('This is stateless functional component example'); | |
| } | |
| return( | |
| <div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| const presentationalComponent = (props) => ( | |
| <div> | |
| <h2> | |
| This is a example of Presentational Component | |
| </h2> | |
| </div> | |
| ); | |
| export default presentationalComponent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| class defaultComponent extends React.Component { | |
| state = { | |
| title: "This is default component class" | |
| } | |
| render() { | |
| const { title } = this.state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react' | |
| export default class Login extends Component { | |
| state = { | |
| email: '', | |
| password: '' | |
| }; | |
| handleOnChange = event => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handleOnChange(event) { | |
| console.log(event.target.name); // the name of the form element | |
| console.log(event.target.value); // the value of the form element | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const object = {} | |
| object['key' + '10'] = 10 | |
| console.log(object.key10) // Outpu -> 10 |