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 { useEffect } from "react"; | |
export const useIntersectionObserver = ( | |
callback: (unknown) => unknown, | |
options = { | |
root: null, | |
threshold: 0.1, | |
rootMargin: "0px", | |
}, | |
reference: HTMLElement | null = null, |
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"; | |
import { NextPageContext } from "next"; | |
const blogPostsRssXml = (blogPosts: IBlogPost[]) => { | |
let latestPostDate: string = ""; | |
let rssItemsXml = ""; | |
blogPosts.forEach(post => { | |
const postDate = Date.parse(post.createdAt); | |
if (!latestPostDate || postDate > Date.parse(latestPostDate)) { | |
latestPostDate = post.createdAt; |
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 { NextPageContext } from "next"; | |
const blogPostsXml = (blogPosts: IBlogPostListItem[]) => { | |
let latestPost = 0; | |
let postsXml = ""; | |
blogPosts.map(post => { | |
const postDate = Date.parse(post.createdAt); | |
if (!latestPost || postDate > latestPost) { | |
latestPost = postDate; | |
} |
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 * as React from "react"; | |
interface OwnProps { | |
myProp:string; | |
} | |
const MyButton: React.FC<OwnProps> = (props) => { | |
return (<button />); | |
} |