React-popper: Error running basic example...

Created on 2 Mar 2017  路  3Comments  路  Source: popperjs/react-popper

Hey. Sorry if I'm missing something obvious, but any idea why I might be getting the following error?

Warning: React.createElement: type is invalid -- expected a string (for built-in
components) or a class/function (for composite components) but got: undefined.
You likely forgot to export your component from the file it's defined in. Check
the render method of PopperExample.

My PopperExample is basically a copy of the example code...

// PopperExample.js
import React from 'react'
import { PopperManager, Target, Popper, Arrow } from 'react-popper'

const PopperExample = () => (
  <PopperManager placement="bottom">
    <Target style={{ width: 120, height: 120, background: '#b4da55' }}>
      Target Box
    </Target>
    <Popper className="popper">
      Popper Content
      <Arrow className="popper__arrow"/>
    </Popper>
  </PopperManager>
);

export default PopperExample;

Most helpful comment

Apologies! I'll work on getting the build published today. I wanted to finalize a couple of things before then. Sorry about that, I wasn't sure anyone was using this yet 馃挬

All 3 comments

+1
seems like current master is not published to npm
and we install https://github.com/souporserious/react-popper/tree/0.0.1

fast workaround:

yarn add souporserious/react-popper

## Webpack config:

{
...
  module: {
    rules: [
      { test: /\.jsx?$/, use: common.babelLoaders, exclude: /node_modules(?!\/react-popper)/ },
     ....

  resolve: {
    extensions: [".js", ".jsx", ".json"]

   ....

## Somewhere.js
import { PopperManager, Target, Popper, Arrow } from 'react-popper/src/react-popper'
...

hope @souporserious will publish last version soon

Apologies! I'll work on getting the build published today. I wanted to finalize a couple of things before then. Sorry about that, I wasn't sure anyone was using this yet 馃挬

Latest release is out 馃帀 enjoy! Please let me know if you find any other issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

souporserious picture souporserious  路  5Comments

Argonanth picture Argonanth  路  4Comments

mogusbi picture mogusbi  路  5Comments

clintharris picture clintharris  路  6Comments

websitesca picture websitesca  路  5Comments