score:2
I am not completely sure but I think the problem lies here: <BlobProvider document={<MyDoc BookingData={booking} />}>
and const MyDoc = ({ data }) =>
. You have to destructure BookingData
in MyDoc
not data
. I think the data
in MyDoc
is conflicting with data
array.
Try this and let me know if it worked:
Change
const MyDoc = ({ data }) => (
<Document>
<Page>
<Text>{data.name}</Text>
</Page>
</Document>
);
to
const MyDoc = ({ pageData }) => (
<Document>
<Page>
<Text>{pageData.name}</Text>
</Page>
</Document>
);
And
<BlobProvider document={<MyDoc BookingData={booking} />}>
to
<BlobProvider document={<MyDoc pageData={booking} />}>
score:0
You pass to const MyDoc = ({ data }) =>
an array of object but when you call the MyDoc you pass an object of bookingdocument={<MyDoc BookingData={booking} />
try to fix this issue.
Intead of passing an array of object pass only the first element and let us know if this fix your issue
Source: stackoverflow.com
Related Query
- React render-pdf open in new page onclick Slow issue
- onClick doesn't render new react component.
- React router - pass api data to the linked component to open with a new page
- Why react new page render from the bottom of the screen?
- Open popup page on onClick event of component react
- React Router - Open Link on new Tab and Redirect to Home Page
- React Router master-detail: children component don't render new view until page refresh
- Nested React Router Component Won't Render on New Page
- React - Log in submit button to render new page
- onClick doesn't render new component in react
- React Router: Render new view without page refresh
- How can i render a new page from footer menu in react JS?
- react js, when open page Other than home in new tab show 404
- Open new page on click of button in react
- How to render new page in React using react-dom-router?
- React router nested, open new page as soon as there are params
- How to open React component as new page from a button in different component
- React router dom v5 history.push does not render new page
- How to open a PDF download into a new tab when calling a GET function from React frontend?
- How render form on new page using React NavLink?
- how to open (after clicking) react component in new page
- React: how to open a new page without render SideBar component
- React Table column filter issue when the page render
- react js How to open new page from child link on content without show previous page
- How to open PDF in browser onClick of React Button?
- How to open a new page and pass data between them in React JS
- Open new page when clicking on a custom react component
- I am new to react. I want to render a child component using a single state using an onClick event in react JS
- I would like to to react router to render a new page
- Adding target=_blank to link tag in button in react does not open new page but disables it?
More Query from same tag
- Express server serves my static files but does not handle requests to my API. What is happening?
- React Bootstrap Dropdown items does not update on state change
- Environment Variables undefined NextJS
- Is it possible to create a reusable function for useSelector?
- View Button, Text, boolean and string don't exist
- how to update the data in firebase database, instead of creating a new data, using reactjs?
- Missing data-reactroot attirbute in React 16
- React Ant Design submenu menu item
- Pagination with json-server and React.js
- How to customize style of React Recaptcha?
- React Native: mobile number validation accept numeric value only
- How to build bundle-stats.json in create react app?
- Modal react component in material-ui app throwing error
- debounce textarea input with react/redux
- I assigned each element in my list a unique key, but am still receiving the 'Warning: Each child in a list should have a unique "key" prop.' error
- How can I do to disable geolocalization?
- React Router 4 - Controlled Component not Un-Mounting on Switch
- ReactJS: Passing a user object as a props to a component results in its value being undefined
- Unexpected end of JSON input on Promise resolve
- Link from react-router-dom is not working properly with material-ui
- Custom CSS doesn't override NavLink in React Bootstrap
- React ANTD DatePicker HTMLCollection not displaying Live values when extracting elements/values
- React: props populated with componentWillMount and Redux
- Passing associative array as props not working
- How to test a component that isn't exported in React
- using lodash get in react componentWillReceiveProps won't work
- How can I map an array of properties to a Bar with that properties in recharts?
- Adding and Removing Data from/to State in Redux/React using Lodash
- ReactJS : onClick in sub-component does not trigger
- Setting up a counter in a document and then retrieve it using Firestore: Would this be alright or would this be too expensive?