简体   繁体   English

reactcodesandbox 不同行为输入不失焦点

[英]react codesandbox different behaviour input does not lose focus

Hello I have created a sandbox with a react table.您好,我创建了一个带有反应表的沙箱。 How ever in the codesandbox everything works fine.如何在代码盒中一切正常。 When I copy the same code to my create-react-app application.当我将相同的代码复制到我的 create-react-app 应用程序时。 The Input loses focus after typing one character.输入一个字符后输入失去焦点。 The versions of the npm packages are the same. npm封装版本相同。 Can somebody explain me this?有人可以解释一下吗? Why does it work in codesandbox?为什么它可以在代码沙盒中工作? And why does this dont work with create-react-app?为什么这不适用于 create-react-app? Here is the codesandbox: Link这是代码框: 链接

It's hard to say without viewing your create-react-app code, but it's most likely because you put your MyDataTable component inside your App component when copying it over, like with these issues:不查看您的 create-react-app 代码很难说,但这很可能是因为您在复制时将MyDataTable组件放在了App组件中,例如以下问题:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM