Posts

Showing posts from March, 2020

API Guidlines (PayPal Standard)

Image
The PayPal platform is a collection of reusable services that encapsulate well-defined business capabilities. Developers are encouraged to access these capabilities through Application Programming Interfaces (APIs) that enable consistent design patterns and principles. This facilitates a great developer experience and the ability to quickly compose complex business processes by combining multiple, complementary capabilities as building blocks. PayPal APIs follow the  RESTful  architectural style as much as possible. To support our objectives, we have developed a set of rules, standards, and conventions that apply to the design of RESTful APIs. These have been used to help design and maintain hundreds of APIs and have evolved over several years to meet the needs of a wide variety of use cases. HTTP Methods List Resources Use HTTP GET method Get an Individual Resource Use HTTP GET method Create a Resource Use HTTP POST method Update a r...

Life Cycle Methods vs React Hooks

Image
Today I am going to talk about life Life Cycle Methods vs React Hooks. First, let me introduce React hooks. React 16.8.0 is the first release to support to support hooks.  Hooks solve a wide variety of seemingly unconnected problems in React that we’ve encountered before. Now we are able to do almost everything in the functional components like class components. Hooks are very easy to learn and use. There are many react hooks. Such as useState, useEffect, useReducer, useContext and etc. In this post, I am going to talk about useEffect and how it is going to use instead of componentDidMount, componentDidUpdate and componentWillUnmount. The  Effect Hook  lets you perform side effects in function components. componentDidMount() vs useEffect() The  componentDidMount ()  method runs after the component output has been rendered to the DOM. We can use it like below: Below showing you how to use useEffect instead of comonentDidMount(). ...

State & Props

Image
Today I am going to talk about State & Props. Both are plain javascript objects and used to store data, but states are used to store information within the component, props are used to pass data to a component. State Let's talk about states first. States are owned by its component. It is mutable. There are two way to initialize states in a class component. Initialize inside the constructor (default way) You have to define your states inside the state object (this.state). Inside an object, we have to define properties as key, value pair. First key then value. You have define state name then give a default value for that state. Directly inside the class Here we are defining states directly inside the class. Below is the way to define states inside functional components. You have to use useState hook to define your states. First give your state name then a function name to update the state. After that you have to give default value for...