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
export const getTotal = ()=>{} | |
export const saveData = ()=>{} |
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
jest.mock("$dashboard/ContactService", ()=> { | |
const actualModule = jest.requireActual("../dashboard/ContactService"); | |
return { | |
__esModule: true, | |
...actualModule, | |
size: 100, | |
deleteContact: jest.fn() | |
} | |
open: jest.fn() | |
}); |
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
jest.mock("react-native-share", ()=> { | |
open: jest.fn() | |
}); |
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, { useMemo } from 'react'; | |
function App() { | |
const arr = [1, 2, 33, 4]; | |
// Memorize output as long as dependency array elements are not changed. | |
const memiozedValue = useMemo(() => getLargestValue(), [arr]); | |
function getLargestValue() { | |
return Math.max(...arr); |
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 routes = [ | |
{ | |
path: "/sandwiches", | |
component: Sandwiches | |
}, | |
{ | |
path: "/tacos", | |
component: Tacos, | |
routes: [ | |
{ |
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'; | |
const UserContext = React.createContext('Yuvraj'); | |
const UserProvider = UserContext.Provider; | |
const UserConsumer = UserContext.Consumer; | |
function UVHeader() { | |
return ( | |
<UserConsumer> |
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'; | |
function SuccessButton (props: any) { | |
return ( | |
<div style={{color: "green"}}>SuccessButton ----------------- {props.data}</div> | |
); | |
} | |
function WarningButton (props: any) { | |
return ( |
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 UVNumber from '../../components/uv_number/uv_number'; | |
import { useSelector } from 'react-redux'; | |
import { UVRootState } from '../../root.reducer'; | |
function UVDashboard() { | |
let uvNumberData = useSelector((state: UVRootState) => { | |
return state.dashboard.numbers; |
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 axios from 'axios'; | |
const getDashboardData = ()=> { | |
return axios.get('https://demo1926272.mockable.io/getInvestments'); | |
} | |
const UVDashboardApi = { | |
getDashboardData: getDashboardData | |
}; |
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, { memo } from 'react'; | |
function UVNumber(props: any) { | |
return ( | |
<div> Memo by Yuvraj Patil</div> | |
) | |
} | |
export default memo(UVNumber); |