Guess who is in the picture ?

Definition

Serverless means build and run applications without thinking about servers.

functions are APIs and APIs are functions

derived from medium article

Functions are the building blocks of serverless computing. They lend themselves naturally to compositions for reusable components, libraries, and applications. Functions-as-a-service platforms offer a model where functions run in response to events, including HTTP requests. In this way, functions are APIs. Going further, cloud-native applications will often interface to third party services via APIs. In order to promote composition across APIs in a serverless model, it is also necessary to treat HTTP requests for services as functions. …


clickOutside using useRef hooks

Firstly, congratulations on the release of React v17.0

Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.

One of the hooks is useRef. We will look into the application of useRef, on how to detect a click outside in React.

Let’s create a new React application

npx create-react-app react-clickoutside

Styling with Tailwind CSS

Follow this installing Tailwind CSS in React.

Let’s create a simple dropdown menu

Now let’s create simple dropdown menu, basically a toggle button.

Replace App.js with following codes.

import React from 'react';
import './styles/main.css';
import Layout from './components/Layout'
const App = () => {
return (
<Layout>
<h1 className="text-3xl text-black pb-6">Outside</h1
</Layout>
);
}

Paul Ho

Next.js/ React.js Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store