score:1
Accepted answer
you can create a reference to the specific project data like this
var allprojectsref = new firebase('https://website.firebaseio.com/projects');
var projectref = allprojectsref.child('project-id-goes-here');
i'm guessing you want this to work for more than one project. you can pass this.props.params.key
in as a variable like this:
var projectid = this.props.params.key;
var allprojectsref = new firebase('https://website.firebaseio.com/projects');
var projectref = allprojectsref.child(projectid);
i'm not sure if this was intentional or just happened to be how you wrote the question, but most of the unique ids in firebase start with a hyphen, so if it's not returning anything, it might be because of that.
the complete documentation is available here: https://www.firebase.com/docs/web/api/firebase/child.html
Source: stackoverflow.com
Related Query
- React Firebase - Fetching an item by id
- Blank Page with React when fetching video from Firebase Storage
- How can i add React loading spinner when item is fetching from database?
- Table body not updating in react , when fetching data from firebase
- Fetching data from Firebase with react
- How to delete single item from realtime Firebase in react app?
- How to access nested Firebase Object item with React
- Fetching data from firebase with React Class component is rendering twice and even more
- React + Firebase v3 - how to get a 2nd reference to firebase to update a single item
- React and Firebase item counter
- Fetching in Firebase Realtime Database with React Js
- Fetching Firebase Data Into A Datatable In React
- React , Redux and Firebase storage image fetching
- How to show a loading indicator in React Redux app while fetching the data?
- Where do I initialize Firebase app in React application?
- Firebase listener with React Hooks
- Firebase hosting with react router
- React bootstrap Navbar: How to right align a navbar item
- How do I use the Firebase onAuthStateChange with the new React Hooks?
- Update single value in item array | react redux
- How to remove the new firebase onAuthStateChanged listener in react
- Check if item exists in array React
- React production router 404 after deep refresh firebase
- Removing an item causes React to remove the last DOM node instead of the one associated with that item
- React list rendering wrong data after deleting item
- React - Firebase - GoogleAuthProvider is not a constructor
- Pass item data to a react modal
- React Router with - Ant Design Sider: how to populate content section with components for relevant menu item
- React JS: how to properly remove an item from this.state.data where data is an array of objects
- How can I serve robots.txt on an SPA using React with Firebase hosting?
More Query from same tag
- How to debug line by line in REACT using VS code editor?
- How to type following object/type in Typescript
- Destructuring and clone object / One line?
- Hide NavBar When Displaying Popup With React
- Permission checks from components in a React/Redux application
- How to render an iframe of local page within React app using React Router Dom
- ReactJS How to use withRouter inside app.js
- React.js - Syntax error: this is a reserved word in render() function
- React Google Maps doesn't import
- How to override css properties of Material UI components
- Is there a way to access global state in createSlice?
- Correct way to unit test/mock shared export function using props from components - React
- Reactjs react router dom useParams not working with dynamic url
- Error in Jimp.loadFont (use load-bmfont module) with React
- React redux normalizr: how to deal with nested entities?
- Why async requests should be made in componentDidMount instead of getInitialState in ReactJS?
- Reading a JSON file from the create-react-app Public folder
- React Class Component - This.Set.State
- Formik form not submitting and reCAPTCHA error message keeps popping up
- motion elements under AnimatePresence not playing exit animation before being removed from the DOM
- Send data from an Object to a React Component
- Any efficient way to render nested json list in React?
- How can I show tooltip info for 4 seconds on page load and then hide, then after show on hover?
- ReactJS form submit preventdefault not working
- How to call a variable within a Redux state?
- React, Conditionally rendering a component based upon communication between a parent and two children components
- How can I use an array map of routes with BrowserRouter and Switch without them all loading at once?
- Trying to use react-papaparse to stream a local file row by row but it's not working - am I coding it correctly or is it just not possible?
- After transpilation of an ES6 module with webpack, module not exported
- If/Else statement in Styled-Components not injecting css code