它显示这样的错误
。
/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) 我正在为聊天应用程序实现表情符号选择器。因此,当用户在输入中键入消息并单击表情符号选择器时,当选择特定表情符号时,我想显示所选表情符号以及用户键入的消息。相反,当用户单击表情符号时,它会显示未定义并在控制台中出现一些错误。
\nfunction 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 得到下面的结果
\nPointerEvent\xc2\xa0{isTrusted: true, pointerId: …
Run Code Online (Sandbox Code Playgroud)