yelp-clone | popular YELP web application | Frontend Framework library
kandi X-RAY | yelp-clone Summary
kandi X-RAY | yelp-clone Summary
In this repo, I had created the CLONE of popular YELP web application using create-react-app as a base from scratch using React (functional component & Custom Hooks), Yelp Fusion REST AP. In addition to the latter technologies, I had styled the application usingBulma CSS and flexbox methodology.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a new search bar
- Generate the search results .
- Creates a new search result .
- Main search function .
- Creates a sub - item menu item .
- Subscribers section .
- Used to render suggestions .
- plays the landing page
- use business functions
- The navigation bar section
yelp-clone Key Features
yelp-clone Examples and Code Snippets
Community Discussions
Trending Discussions on yelp-clone
QUESTION
I have a UserContext.js file which holds all of the useContext hooks. a Nav.js that displays some user info and a "Sign in" OR "Sign out" button. a Profile.js that displays user info. App.js that holds components and useContext.
Whats happening is if i sign in with a user everything gets displayed and i can navigate to various pages and the user information stays displayed. If i click Sign Out from the nav menu all of the user information instead of displaying “No User Info” shows empty fields on all the pages. And the “Sign Out” button appears again. I think this is happening because the UserContextProvider thats wrapping all of my components in App.js are calling auth.signout from the toggleUser function every time i navigate to a different page ? could i extract the toggleUser function out of the scope of UserContextProvider ? Or is something else happening?
App.js
...ANSWER
Answered 2021-Nov-22 at 05:30If I had to venture a guess as to why users don't stay "logged out" it is because of the inner subscription in the useEffect
not being unsubscribed to as well. It can still update the user
state.
Ensure you also reset the currentUser
state to null when there'e a falsey userAuth
value in the onAuthStateChanged
callback.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install yelp-clone
Installed dependencies
Start the development server
It leverages the free Yelp Fusion REST API for which you need an API key.
Head over to the Yelp Fusion API documentation.
Click on Create App and sign in if you haven't done so already
Once you have signed in, click on the Get Started button. If you already have an app, then you will already see the API key
Copy the generated API key. This is a bearer token that must be put inside the header of each request
Navigate to the .env file and assign the BEARER_TOKEN variable the following content REACT_APP_YELP_API_KEY = <your-token-here>
Run the app with npm start or yarn start
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page