Build real-time applications with PubNub pub/sub messaging
Does it follow best practices?
Evaluation — 88%
↑ 1.28xAgent success when using this tile
Validation for skill structure
An online auction platform is building a real-time bidding feature as a React component. When a user views an auction item, the component should connect to a channel for that specific auction and display incoming bids in real time. Users should also be able to place bids through the same component. The platform has experienced memory leaks in production because previous implementations did not properly clean up PubNub connections when users navigated away from auction pages.
The team needs a React component that manages the full PubNub connection lifecycle correctly. The component receives the current user's ID and the auction item ID as props, connects to the appropriate channel, displays real-time bid updates, and allows the user to submit new bids. It must handle navigation between different auction items without leaking connections.
Produce a single React component file named AuctionBidPanel.jsx (or .tsx) that:
userId and auctionId as props