Giter Site home page Giter Site logo

Comments (9)

EtienneLem avatar EtienneLem commented on July 21, 2024

Could I see a snippet of how you’re trying to use it?
What version of React are you using? I’ll try to reproduce.

from emoji-mart.

onekvinda avatar onekvinda commented on July 21, 2024

I am getting the same error with React 15.3.0.

from emoji-mart.

EtienneLem avatar EtienneLem commented on July 21, 2024

Any chance I can see how you’re importing/using the library? Thanks!

from emoji-mart.

onekvinda avatar onekvinda commented on July 21, 2024

Basically I am just trying that in the empty component, so nothing fancy

import React, {Component, PropTypes} from 'react';
import {emojify} from 'react-emojione';
import {Picker} from 'emoji-mart'

export default class MessageEditor extends Component {
    render() {
        return (
            <div>
                <Picker sheetURL='https://npmcdn.com/[email protected]/sheets/sheet_apple_64.png'/>
            </div>
        )
    }
}

I can try that in some clean project to rule out it's not for example issue with the node modules in my current project

from emoji-mart.

EtienneLem avatar EtienneLem commented on July 21, 2024

It does look good.

There’s a chance that it’s because you have multiple versions of React installed locally.
Try npm ls | grep react, if you see more than one version that’s probably the issue.

You could either rm -rf node_modules and npm install or try only removing the extra React you don’t need.

from emoji-mart.

jeduan avatar jeduan commented on July 21, 2024

I had this same issue. I didn't have 2 reacts installed, however, It turned out that the culprit was that I had configured ProvidePlugin on webpack, like so:

plugins: [
  new webpack.ProvidePlugin({
      React: 'react'
  })
]

so it would see both React and react. The fix was loading Picker directly from src and make a special case in webpack's config to use emoji-mart's source.

import Picker from 'emoji-mart/src/components/picker';

on webpack.config:

loaders: [...,
  {
        test: /\.js$/,
        include: [
          path.join(__dirname, 'src'),
          path.join(__dirname, 'node_modules', 'emoji-mart')
        ],
        loader: 'babel-loader'
    },
]

from emoji-mart.

rachitGulati avatar rachitGulati commented on July 21, 2024

I am facing the same problem. Any update for this ?. I really liked this library and wanted to use it in my project.

I don't have duplicate react js version still I have tried rm -rf node_moduels and reinstalling it still no luck.

Just adding simple one line in my project

And it is showing the above error.

from emoji-mart.

EtienneLem avatar EtienneLem commented on July 21, 2024

Do you also use webpack.ProvidePlugin?
I’ll try to reproduce.

from emoji-mart.

rachitGulati avatar rachitGulati commented on July 21, 2024

Thanks for fixing it now it's working superb.

No I was not using the ProvidePlugin.

from emoji-mart.

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.