小编Kri*_*. V的帖子

从“firebase”模块导入 firebase 在reactjs中不起作用

它显示这样的错误

/firebase.js:2:0
Module not found: Package path . is not exported from package C:\Users\krish\Desktop\FACEBOOK _CLONE\facebook_clone\node_modules\firebase (see exports field in C:\Users\krish\Desktop\FACEBOOK _CLONE\facebook_clone\node_modules\firebase\package.json)
Did you mean './firebase'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of …
Run Code Online (Sandbox Code Playgroud)

firebase reactjs npm-install next.js

2
推荐指数
1
解决办法
1万
查看次数

在 emoji-picker-react@4.3.0 中获取未定义的表情符号

我正在为聊天应用程序实现表情符号选择器。因此,当用户在输入中键入消息并单击表情符号选择器时,当选择特定表情符号时,我想显示所选表情符号以及用户键入的消息。相反,当用户单击表情符号时,它会显示未定义并在控制台中出现一些错误。

\n
function ChatInput() {\n    const [msg,setMsg] = useState('')\n    const [showEmojiPicker,setShowEmojiPicker] = useState(false);\n\n    const handleShowEmoji = () => {\n        setShowEmojiPicker(!showEmojiPicker);\n    }\n\n    const handleEmojiClick = (event,emojiObject) => {\n        console.log(emojiObject);\n        let message = msg;\n        message += emojiObject.emoji;\n        setMsg(message);\n    }\n\n  return (\n    <Container>\n        <div className="button-container">\n            <div className="emoji">\n                <BsEmojiSmileFill onClick={handleShowEmoji}/>\n                {showEmojiPicker && <Picker onEmojiClick={handleEmojiClick}/> }\n            </div>\n        </div>\n        <form className='input-container'>\n            <input type='text' placeHolder='type your message here' value={msg} onChange={(e) => setMsg(e.target.value)}/>\n            <button className='submit'>\n                <IoMdSend/>\n            </button>\n        </form>\n    </Container>\n    )\n}\n
Run Code Online (Sandbox Code Playgroud)\n

在控制台中安慰 emojiObject 得到下面的结果

\n
PointerEvent\xc2\xa0{isTrusted: true, pointerId: …
Run Code Online (Sandbox Code Playgroud)

javascript emoji reactjs

0
推荐指数
1
解决办法
3063
查看次数

标签 统计

reactjs ×2

emoji ×1

firebase ×1

javascript ×1

next.js ×1

npm-install ×1