This file contains 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 'dart:convert'; | |
dynamic parseJson(String jsonString, String path) { | |
var json = jsonDecode(jsonString); | |
List<String> parts = path.split('.'); | |
dynamic element = json; | |
for (var part in parts) { | |
if (part.contains('[') && part.contains(']')) { |
This file contains 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, { useState, useEffect, useRef } from 'react'; | |
interface VisibilityObserverProps { | |
children: (props: { elementRef: React.RefObject<HTMLDivElement>, isVisible: boolean }) => JSX.Element; | |
} | |
const VisibilityObserver: React.FC<VisibilityObserverProps> = ({ children }) => { | |
const [isVisible, setIsVisible] = useState(false); | |
const elementRef = useRef<HTMLDivElement>(null); |
This file contains 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 dynamic from 'next/dynamic' | |
import React from 'react' | |
const NoSsr = props => ( | |
<React.Fragment>{props.children}</React.Fragment> | |
) | |
export default dynamic(() => Promise.resolve(NoSsr), { | |
ssr: false | |
}) |
OlderNewer