Skip to content

Instantly share code, notes, and snippets.

View sriramveeraghanta's full-sized avatar
🎯
Focusing

sriram veeraghanta sriramveeraghanta

🎯
Focusing
View GitHub Profile
@sriramveeraghanta
sriramveeraghanta / react-image.js
Last active December 11, 2019 15:39
Image Safe Loading When src doesnt load.
import React from "react";
function useFallbackImageInSSR(fallbackSrc) {
const ref = React.useRef(null);
const onError = React.useCallback(
event => {
event.target.src = fallbackSrc;
},
[fallbackSrc]
);
@sriramveeraghanta
sriramveeraghanta / Main.js
Last active March 28, 2020 18:14
React Bootstrap DropDown Select
function main(){
const [values, setValues] = React.useState({
media_type: ""
});
const options = [
{name: "Facebook", value: "FACEBOOK", icon: faFacebook},
{name: "LinkedIn", value: "LINKEDIN", icon: faLinkedIn},
{name: "Instagram", value: "INSTAGRAM", icon: faInstagram},
@sriramveeraghanta
sriramveeraghanta / transition.html
Last active October 10, 2017 20:38
Circle Swapping
<!--transition.html-->
<html>
<head>
<title>D3 Tutorial</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
</head>
<body>
<script>
var width = 10000;