Giter Site home page Giter Site logo

Home - Sticky Nav Bar about airbnb-clone HOT 12 OPEN

aryamankha avatar aryamankha commented on June 12, 2024
Home - Sticky Nav Bar

from airbnb-clone.

Comments (12)

Alphx-rgb avatar Alphx-rgb commented on June 12, 2024

I'll work on this.

from airbnb-clone.

aryamankha avatar aryamankha commented on June 12, 2024

Great - assigning to you

from airbnb-clone.

Alphx-rgb avatar Alphx-rgb commented on June 12, 2024

I have almost created the component but stuck on some errors . Should I update the code for everybody to view?

from airbnb-clone.

aryamankha avatar aryamankha commented on June 12, 2024

What are the errors you found? If you can get it to a place where there are no breaking changes, we can create a new issue to fix the errors you have. Right now, I'm getting an "object is not iterable erro" on AppSearchBar

from airbnb-clone.

Rishabh2324 avatar Rishabh2324 commented on June 12, 2024

Is this issue fixed... ? Facing same error

from airbnb-clone.

Alphx-rgb avatar Alphx-rgb commented on June 12, 2024

yeah, this is the error I am facing too... I am checking several resources but have not been able to figure out a solution. I guess we can create a new issue for this. In the meanwhile, I'll try myself also for correcting the same. And after this issue gets fixed, We can focus on building more components.

from airbnb-clone.

Rishabh2324 avatar Rishabh2324 commented on June 12, 2024

Take reference from this

  1. First update DataContext

export const initialState: IInitialState = { location: '', checkIn: null, checkOut: null, guests: { adults: 0, children: 0, infants: 0 }, };

export const DataContext = createContext<{ state: IInitialState; dispatch: React.Dispatch<any>; }>({ state: initialState, dispatch: () => null, });

interface IIProps { children: React.ReactNode; }

export const ContextProvider = ({ children }: any) => { const [state, dispatch] = useReducer(dataReducer, initialState); return ( <> <DataContext.Provider value={{ state, dispatch }}> {children} </DataContext.Provider> </> ); };

  1. While using your context in Date range Destruture like this
    const { state, dispatch } = useDataContext();
    const { location, checkIn, checkOut, guests } = state;

  2. Also add ContextProvider to parent component so that dispatch can work

  3. Avoid using any

  4. You might also need to add some null checks on you component while using state

This worked for me

from airbnb-clone.

Alphx-rgb avatar Alphx-rgb commented on June 12, 2024

I am facing a few errors which I am unable to resolve. I'll work on it, if I get it, I'll make a PR.

from airbnb-clone.

Hamjaster avatar Hamjaster commented on June 12, 2024

I'd like to work on it. Please assign it to me.

from airbnb-clone.

aryamankha avatar aryamankha commented on June 12, 2024

Assigning it to you

from airbnb-clone.

Hamjaster avatar Hamjaster commented on June 12, 2024

I've a question, what does Vivid in "Sticky Nav by using Vivid" means??

from airbnb-clone.

Hamjaster avatar Hamjaster commented on June 12, 2024

I ran the code in my local environment, Theres just a simple navbar in it? what to do, ? I am quite confused

from airbnb-clone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.