question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integrating with react-boilerplate

See original GitHub issue

Environment(required)

  • antd version: latest
  • OS and its version: Ubuntu 16.04
  • Browser and its version: Chrome, latest

What did you do? Please provide steps to re-produce your problem.

  • Download and install react-boilerplate
  • Download and install antd
  • Add the following to the dev webpack config to make it work:
babelQuery: {
    plugins: [["import", { libraryName: "antd", style: true }]],
  },
  • Add the same to production config. Use npm build to build production assets.

What do you expected?

  • Expect components to work normally, like in dev environment.

What happen?

I get errors like ReferenceError: Menu is not defined

Re-producible online demo

I cant reproduce this online because it seems like a build issue.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

17reactions
afc163commented, Mar 1, 2017

I found a workaround but I don’t know why yet. The dot can’t existed in JSX expression for production environment of react-boilerplate.

+ const MenuItem = Menu.Item;

...

<Menu>
- <Menu.Item></Menu.Item>
+ <MenuItem></MenuItem>
</Menu>
12reactions
afc163commented, Mar 2, 2017

Remove this line and it also works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to build your own React boilerplate - Medium
This folder structure is basic and will evolve as you integrate other libraries in the project. Git Ignore. Once we build our project,...
Read more >
React Boilerplate for Faster Development - Praxent
The boilerplate presents developers with a local, live development server, a production development build script and pre-arranged folder ...
Read more >
react-boilerplate/react-boilerplate: A highly scalable, offline ...
Quick scaffolding: Create components, containers, routes, selectors and sagas - and their tests - right from the CLI! · Instant feedback · Predictable...
Read more >
12+ React Boilerplates & Starter Kits for Developers in 2022
1. Create React App · 2. React Boilerplate · 3. Gatsby Static · 4. React Starter Kit · 5. Electron React Boilerplate ·...
Read more >
Boilerplate Demo for React and Leaflet Map Integration - Loom
Use Loom to record quick videos of your screen and cam. Explain anything clearly and easily – and skip the meeting. An essential...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found