{"id":22310,"library":"rollup-react-npm","title":"Rollup React NPM","description":"A boilerplate for building React components with Rollup and publishing to npm. Version 1.1.23 requires React 16.2+, lodash 4.17+, and antd 3.1+. It provides a minimal setup with Babel transpilation and a single default export. Alternative to create-react-library and nwb.","status":"active","version":"1.1.23","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install rollup-react-npm","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-react-npm","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-react-npm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency","package":"lodash","optional":false},{"reason":"peer dependency","package":"react","optional":false},{"reason":"peer dependency","package":"react-dom","optional":false},{"reason":"peer dependency","package":"antd","optional":false}],"imports":[{"note":"Only default export is provided; named export will be undefined.","wrong":"import { MyComponent } from 'rollup-react-npm'","symbol":"default","correct":"import MyComponent from 'rollup-react-npm'"},{"note":"CommonJS require does not unwrap default; must access .default.","wrong":"const MyComponent = require('rollup-react-npm')","symbol":"MyComponent","correct":"const MyComponent = require('rollup-react-npm').default"}],"quickstart":{"code":"import MyComponent from 'rollup-react-npm'\nimport 'antd/dist/antd.css' // required for antd styles\n\nfunction App() {\n  return (\n    <div>\n      <MyComponent />\n    </div>\n  )\n}\n\nexport default App","lang":"javascript","description":"Basic usage: import default component from the package and render it. Note that antd CSS must be imported separately."},"warnings":[{"fix":"Migrate to a modern React component library or update the boilerplate.","message":"This package has not been updated since 2019 and relies on React 16.2.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use import MyComponent from '...' instead of destructuring.","message":"Only default export is available; named imports will result in undefined.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add import 'antd/dist/antd.css' in your entry file.","message":"Missing antd CSS import will cause components to render without styles.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use import MyComponent from 'rollup-react-npm' (no braces).","cause":"Using named import instead of default import.","error":"TypeError: Cannot read property '...' of undefined"},{"fix":"Ensure antd CSS is imported and antd 3.x is installed.","cause":"Missing antd CSS import or antd version mismatch.","error":"Error: Module \".../node_modules/antd/lib/...\" does not provide a default export"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}