Closed ChrisCross3 closed 3 years ago
Good evening, I pass a Document id from one view to another an then want to get access to the Document.
Based on the documentation, I thought I could do this: const product = new Document('products/' + props.match.params.id)
const product = new Document('products/' + props.match.params.id)
The created object has the right path, but no data.
ATM I do it like this and it works: const product = products.docs.find( (doc) => doc.id == props.match.params.id);
const product = products.docs.find( (doc) => doc.id == props.match.params.id);
Is this also an appropriate way?
Did you wrap your React component with observer ?
Good evening, I pass a Document id from one view to another an then want to get access to the Document.
Based on the documentation, I thought I could do this:
const product = new Document('products/' + props.match.params.id)
The created object has the right path, but no data.
ATM I do it like this and it works:
const product = products.docs.find( (doc) => doc.id == props.match.params.id);
Is this also an appropriate way?