-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-pdf-render support for React 18 #1971
Comments
I am using React 18 Kindly support this |
You can solve it using |
@DercilioFontes thanks for the response. |
@karthic-kailanware |
@ShaiMahnai, you will override only to add the new config properties necessary to have the missing node packages that react-pdf requires and are not added by default in Webpack 5 anymore. The original config will be kept. The override function gives you the config parameter. You can spread it (...config) and add the new properties. |
How can I override only specific parameter? Can you please attach an example? |
// ./config-overrrides.js
const webpack = require('webpack');
module.exports = function override(config, env) {
// New config, e.g. config.plugins.push...
config.resolve.fallback = {
...config?.resolve?.fallback,
process: require.resolve('process/browser'),
zlib: require.resolve('browserify-zlib'),
stream: require.resolve('stream-browserify'),
util: require.resolve('util'),
buffer: require.resolve('buffer'),
assert: require.resolve('assert'),
};
config.plugins = [
...config.plugins,
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser',
}),
];
return config;
}; Please, check the docs on https://github.com/timarney/react-app-rewired and https://react-pdf.org/advanced#webpack-config. |
is there any temp workaround? |
Looks like the https://react-pdf.org/advanced#webpack-config section has been removed for some reason. I remember following that before to get this working. Why has that been removed? |
It seems the new version, 3.0.0, doesn't need it anymore. I tested my project that had it and removed the webpack override, which worked fine. But they could keep the documentation for who is still using it. |
@diegomura if you don't want to maintain the react-pdf-renderer anymore, just tell us, so we can go for alternatives. |
duplicate of #1878 |
My project is using create-react-app 5
having the following issue:
Is it possible react-pdf/renderer not supported by react 18?
The text was updated successfully, but these errors were encountered: