Giter VIP home page Giter VIP logo

Comments (10)

Okami92 avatar Okami92 commented on July 19, 2024 1

Yes, it works! Thanks a lot man! I wouldn't think about it without you 👍

from react-to-print.

gregnb avatar gregnb commented on July 19, 2024

Hey @Okami92 sorry to hear that. Can you try visiting: https://kmmw7l39y7.codesandbox.io/#

Does that work for you?

from react-to-print.

Okami92 avatar Okami92 commented on July 19, 2024

@gregnb yes, this works. could you please help me with my issue? do you have any ideas how this is possible?

http://prntscr.com/kau111

not sure what is wrong here

from react-to-print.

gregnb avatar gregnb commented on July 19, 2024

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.

Okami92 avatar Okami92 commented on July 19, 2024

@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.

gregnb avatar gregnb commented on July 19, 2024

Great sounds good!

from react-to-print.

Okami92 avatar Okami92 commented on July 19, 2024

@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.

gregnb avatar gregnb commented on July 19, 2024

Ok I will try to look at this when I get some time today. Thank you

from react-to-print.

gregnb avatar gregnb commented on July 19, 2024

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.

gregnb avatar gregnb commented on July 19, 2024

No problem!

from react-to-print.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.