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 { | |
SafeAreaView, | |
SafeAreaProvider, | |
} from 'react-native-safe-area-context'; | |
import { | |
FlatList, | |
StyleSheet, | |
View, | |
} from 'react-native'; | |
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
const App = () => { | |
const parentRef = useRef<HTMLDivElement | null>(null); | |
const firstRef = useRef<HTMLDivElement | null>(null); | |
const secondRef = useRef<HTMLDivElement | null>(null); | |
const resizerRef = useRef<HTMLDivElement | null>(null); | |
const mouseXCor = useRef(0); | |
const firstWidth = useRef(0); | |
const shouldDrag = useRef(false); | |
const onMouseDown = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => { |
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
// Calling a async action without using thunk or saga in the component itself | |
function mapDispatchToProps(dispatch: Dispatch<MyAction>): Pick<Props,'getPosts'> { | |
return: { | |
getPosts: async () => {return dispatch( getAction( await fetch('/stuff') ) );}, | |
}; | |
} |