Twitter (mini)clone with React and Firebase
nomadcoders / nwitter Goto Github PK
View Code? Open in Web Editor NEWCloning Twitter with React and Firebase
Cloning Twitter with React and Firebase
There are two supplements about when 'choose file' is canceled.
[1] the reader cannot read null as dataUrl, should be better to add condition like,
if(theFile) {
reader.readAsDataURL(theFile)
}
[2] when clear button is clicked, the value of this input[type=file] should be initialized in the function onClearAttachment like,
document.querySelector('input[type=file]').value = ''
Please reply better solution.
I can't start lecture #5.0 because error("not change My profile Page show log out button") and history() error...
Before I did
$ npx create-react-app nwitter
$ npm i [email protected]
$ npm i [email protected]
$ npx create-react-app nwitter
$ npm install react react-dom
$ npm install uuid
Different file is Router.js..
https://github.com/nomadcoders/nwitter/commit/c957fa1bb4d7e92c21121998952109034f68a3f9 "dependencies": { "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.2.0", "@testing-library/user-event": "^13.5.0", "firebase": "^9.6.1", "react": "^18.1.0", "react-dom": "^18.1.0", "react-router-dom": "^5.3.0", "react-scripts": "5.0.1", "uuid": "^8.3.2", "web-vitals": "^2.1.4" },Thank you for always.
[Issue description]
If nweet doesn't have an attachment image url, delete nweet shows error like this,
"Firebase Storage: Invalid argument in refFromURL at index 0: Expected full URL but got a child path, use ref instead."
So, it need to delete nweet with condition about attachment url like,
if (nweetObj.attachmentUrl) {
await storageService.refFromURL(nweetObj.attachmentUrl).delete()
}
If there are better solution, please leave a comment.
Hi, Nico.
I'm student learning nwitter.
I watched your lesson until 3.1 and I have a problem with firestore.
This is my code.
https://github.com/do-park/twitter/blob/master/src/routes/Home.js
When I click 'tweet' button, nothing is happened.
So I want to check error message, but console.log in then()
and catch()
is also not working!
How can I solve the problem?
I need your help!
The browser alert that if async task in callback(include setState) of React.useEffect is fired after component unmount(kind of log out), then there is a memory leak possibility. I think it'd be better to prevent it via conditional setState(by returning a clean up function of useEffect) like below.
useEffect(() => {
let isMount = true
if(isMount) {
setNweets(nweetArray)
}
return () => isMount = false
}, [])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.