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 from "react"; | |
import { View, Text, StyleSheet, Dimensions } from "react-native"; | |
import SearchHOC from "./SearchHOC"; | |
const { height, } = Dimensions.get("screen"); | |
const TodoList = ({data}) => { | |
let renderTodo = data.map((todo) => { | |
return ( | |
<View key={todo.id} style={styles.row}> |
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 from "react"; | |
import { View, Text, StyleSheet, Dimensions } from "react-native"; | |
import SearchHOC from "./SearchHOC"; | |
const { height } = Dimensions.get("screen"); | |
const UserList = ({ data }) => { | |
let renderUsers = data.map((user) => { | |
return ( | |
<View key={user.id} style={styles.row}> |
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 from "react"; | |
import { View, Text, StyleSheet, Dimensions, TextInput } from "react-native"; | |
const { height, width } = Dimensions.get("screen"); | |
const SearchHOC = (Component, entity) => { | |
return class extends React.Component { | |
state = { | |
data: [], | |
search: "", |
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, { useEffect, useState } from "react"; | |
import { View, Text, StyleSheet, Dimensions, TextInput } from "react-native"; | |
const { height, width } = Dimensions.get("screen"); | |
const UserList = () => { | |
const [users, setUsers] = useState([]) | |
const [search, setSearch] = useState("") | |
useEffect(() => { | |
const fetchUsers = async () => { |
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
const triple = multiplyBy(3); | |
console.log(triple(4)) //result: 12 |
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
const double = multiplyBy(2); | |
console.log(double(4)) //result: 8 |
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
function multiplyBy(a) { | |
return function(b) { | |
return a * b; | |
}; | |
} |
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
function SuperHero(){ | |
} | |
const MemoizedSuperHero = React.memo(MovieTitle) | |
export default MemoizedSuperHero; |
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 from 'react'; | |
import {Text} from 'react-native'; | |
export default class SuperHero extends React.PureComponent { | |
render() { | |
console.warn("SuperHero is rendered"); | |
return ( | |
<Text style={{ fontWeight: "bold" }}>SuperHero: {this.props.hero} </Text> | |
); | |
} |
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 from 'react'; | |
import {Text} from 'react-native'; | |
export default class SuperHero extends React.Component { | |
render() { | |
console.warn("SuperHero is rendered"); | |
return ( | |
<Text style={{ fontWeight: "bold" }}>SuperHero: {this.props.hero} </Text> | |
); | |
} |
NewerOlder