Comments (10)
Yes, it works! Thanks a lot man! I wouldn't think about it without you 👍
from react-to-print.
Hey @Okami92 sorry to hear that. Can you try visiting: https://kmmw7l39y7.codesandbox.io/#
Does that work for you?
from react-to-print.
@gregnb yes, this works. could you please help me with my issue? do you have any ideas how this is possible?
not sure what is wrong here
from react-to-print.
Could you paste me your package.json and also is there any chance you could share the portion of your app that does the printing into a separate repo so we could look into it? more than happy to help
from react-to-print.
@gregnb sure, thanks a lot! I'll prepare separate repo for you in a moment
"name": "",
"version": "1.0.0",
"description": "npm i -g prettier",
"main": "index.js",
"scripts": {
"clean": "rimraf dist",
"dev": "cross-env NODE_ENV=development node devServer.js",
"build": "npm run clean && cross-env NODE_ENV=production webpack --config=webpack.build.config.js -p && node productionServer.js",
"flow": "flow"
},
"author": "",
"license": "ISC",
"browserslist": [
"last 5 versions",
"not ie < 11"
],
"prettier": {
"singleQuote": true,
"trailingComma": "all"
},
"dependencies": {
"axios": "^0.18.0",
"babel-plugin-styled-components": "^1.5.1",
"es6-promise": "^4.2.4",
"prop-types": "^15.6.1",
"qs": "^6.5.2",
"react": "^16.3.2",
"react-custom-scrollbars": "^4.2.1",
"react-dnd": "^3.0.2",
"react-dnd-touch-backend": "^0.4.0",
"react-dom": "^16.3.2",
"react-motion": "^0.5.2",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-slick": "^0.23.1",
"react-to-print": "^2.0.0-beta-3",
"redux": "^4.0.0",
"redux-thunk": "^2.2.0",
"slick-carousel": "^1.8.1",
"styled-components": "^3.2.6",
"xml2js": "^0.4.19"
},
"devDependencies": {
"autoprefixer": "^8.3.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"browserslist": "^3.2.4",
"compression-webpack-plugin": "^1.1.11",
"cross-env": "^5.1.4",
"css-loader": "^0.28.11",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.7.0",
"express": "^4.16.3",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^1.1.11",
"flow-bin": "^0.70.0",
"html-webpack-plugin": "^3.2.0",
"image-webpack-loader": "^4.2.0",
"node-sass": "^4.8.3",
"postcss-loader": "^2.1.4",
"prettier-eslint": "^8.8.1",
"react-hot-loader": "^4.0.0",
"rimraf": "^2.6.2",
"sass-loader": "^7.0.1",
"style-loader": "^0.20.3",
"url-loader": "^1.0.1",
"webpack": "^4.6.0",
"webpack-cli": "^2.1.2",
"webpack-dev-middleware": "^3.1.2",
"webpack-hot-middleware": "^2.22.1"
}
}
from react-to-print.
Great sounds good!
from react-to-print.
@gregnb done: https://github.com/Okami92/print-error
npm i, npm run build - you'll see an error.
when npm run dev, it works fine.
from react-to-print.
Ok I will try to look at this when I get some time today. Thank you
from react-to-print.
Ok, so this issue comes from the fact that stateless components do not have refs:
facebook/react#4936
If you were to change your Printable component to a stateful component (ie: class Printable extends React.component) then this library will be able to attach to that ref.
I will look to add a warning into the library if the component to print happens to be stateless
from react-to-print.
No problem!
from react-to-print.
Related Issues (20)
- Opera on IOS and Yandex Browser on IOS dont printing HOT 5
- [BUG] [FEATURE] Can not config counter page in footer iframe HOT 5
- Page break wide content HOT 3
- Superscripts <sup/> and subscripts <sub/> HOT 1
- react-to-print custom print html content dev vs prod discrepancy HOT 4
- [BUG] [TEMPORARY FIX] - Print container on Chrome + MUI is hiding `Header and Footers` option as default behavior HOT 5
- The FOOTER to only display at the LAST PAGE HOT 3
- codesandbox examples are not loading HOT 2
- onAfterPrint is called before print iframe appears HOT 1
- On mobile devices are not truncated accordingly ref HOT 1
- Add Border to every Page HOT 4
- Add dynamic colors to print function HOT 1
- How to check that the user click on Save in `onAfterPrint`? HOT 2
- getting Supplied Data is not a valid base64-String jsPDF.convertStringToImageData erorr while directly downloading image HOT 1
- Border top and bottom HOT 1
- Save as PDF hangs in print view HOT 1
- Blank PDF when trying to generate in production. HOT 2
- How should i handle large data to print? HOT 8
- Why does it render different content when in im browsing in mobile HOT 3
- Blank Page while printing after a certain period of time HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-to-print.