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 Other = () => { | |
console.log("Merhabalar"); | |
return <div>Merhabalar, ben dahil edilen component'im</div>; | |
}; |
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
class App extends Component { | |
state = { | |
firstName: "Erdem", | |
value: null | |
}; | |
render() { | |
return ( | |
<div> | |
Merhaba React |
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 Other = memo(() => { | |
console.log("Merhabalar"); | |
return <div>Merhabalar, ben dahil edilen component'im</div>; | |
}); |
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 } from 'react' | |
const App = () => { | |
useEffect(() => { | |
console.log('component did mount'); | |
}, []); | |
return ( | |
<div> | |
React app |
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 } from 'react' | |
const App = () => { | |
const [value, setValue] = useState('') | |
useEffect(() => { | |
console.log('component did update'); | |
}); | |
return ( |
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 } from 'react' | |
const Child = () => { | |
useEffect(() => { | |
console.log('componentDidMount') | |
return () => { | |
console.log('componentWillUnmount') | |
} | |
}, []); |
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 } from 'react' | |
import Child from './Child' | |
const App = () => { | |
const [value, setValue] = useState('') | |
return ( | |
<div> | |
React app | |
<input |
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
// Child Component | |
// Child Component | |
// Child Component | |
import React, { useEffect, useState } from 'react' | |
import { string } from 'prop-types' | |
const Child = ({ value }) => { | |
const [childValue, setChildValue] = useState(value) | |
useEffect(() => { |
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 } from 'react'; | |
import UserDetails from './components/UserDetails'; | |
const App = () => { | |
let inputRef; | |
const [username, setUsername] = useState(null); | |
return ( | |
<div> |
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 { string } from 'prop-types'; | |
import useGithub from '../hooks/useGithub'; | |
const UserDetails = ({ username }) => { | |
const { user, error, isLoading } = useGithub(username); | |
if (isLoading) { | |
return ( |
OlderNewer