AlexWang-16 / react-lex-plus

5 stars 5 forks source link

Uncaught ReferenceError: props is not defined #20

Open mealbarracin10 opened 2 years ago

mealbarracin10 commented 2 years ago

I'm trying to integrate an amazon lex chatboot on a demo application

"react": "^17.0.1", "react-lex-plus": "^1.2.3",

import React from 'react';
import LexChat from "react-lex-plus";

const Aws = () => {
    return (
    <LexChat
      botName="WebUiOrderFlowers"
      IdentityPoolId="us-east-1:XXXXXXXX"
      placeholder="Placeholder text"
      backgroundColor="#FFFFFF"
      height="430px"
      region="us-east-1"
      headerText="Chatbot"
      headerStyle={{ backgroundColor: "#000000", fontSize: "15px" }}
      greeting={
        "Hello, how can I help? You can say things like 'help' to get more info"
      }
    />
    )
} 

export default Aws; 

The chatboot appear on the down size, but when I tried to send any text it show me on the console index.js:8 Uncaught ReferenceError: props is not defined at o.value (index.js:8) at HTMLUnknownElement.callCallback

AlexWang-16 commented 2 years ago

Hi @mealbarracin10, thanks for reporting this bug. I have confirmed this bug on my end as well. I will be releasing a fix shortly.

AlexWang-16 commented 2 years ago

I've published a patch version for this project react-lex-plus 1.2.4. Would you please upgrade the package and let me know if you're still experiencing issues?

mealbarracin10 commented 2 years ago

Seems on the build is no applying those changes

this is the index.js file on the node_modules

var i={botAlias:props.alias,botName:this.props.botName,inputText:r,userId:this.state.lexUserId,sessionAttributes:this.state.sessionAttributes}

on the botAlias is using props instead this.pops

With that change it works

AlexWang-16 commented 2 years ago

Thanks for the feedback. It looks like the previous update didn't register correctly. I've pushed 1.2.5 to fix this. It looks good on my end, can you test 1 more time?