简体   繁体   English

反应删除 bootstrap.tsx

[英]React remove bootstrap.tsx

Hello i have created new react app您好,我创建了新的 React 应用程序

there is index.tsx in src and all it contains is src 中有index.tsx ,它包含的是

 import("./bootstrap")

if i remove this import or modify it the app stops working如果我删除此导入或修改它,应用程序将停止工作

the bootstrap.tsx file contains this bootstrap.tsx文件包含这个

import React from 'react';
import { render } from 'react-dom';
import App from './App';

const Root: React.FC = () => <App />;

render(<Root />, document.getElementById('root'));

how can i remove it?我怎样才能删除它?

i would like to if my index.tsx would containt我想如果我的 index.tsx 包含

something like this像这样的

ReactDOM.render(
    <BrowserRouter>
      <App />
    </BrowserRouter>,

  document.getElementById('root')

app.tsx应用程序.tsx




interface AppProps {
  appPath?: string;
}

const App: React.FC<AppProps> = () => {
  return (
    <HashRouter>
      <Route path="/" exact component={View1Component} />
    </HashRouter>
  );
};

export default App;


I just came across this problem.我刚遇到这个问题。

To remove bootstrap simply run the command below in your terminal要删除引导程序,只需在终端中运行以下命令

npm uninstall bootstrap npm 卸载引导程序

This will automatically uninstall bootstrap from your dependencies这将自动从您的依赖项中卸载引导程序

Hi and welcome to Stack Overflow.嗨,欢迎来到 Stack Overflow。

Just by the nature of this question I assume there's plenty answers on the internet and for sure in SO that will answer this.就这个问题的性质而言,我认为互联网上有很多答案,并且肯定会回答这个问题。

Also, I invite you to put the error that it appears when you remove that bootstrap import.另外,我邀请您提出删除引导程序导入时出现的错误。

However, I will try my best for now, have you tried the obvious, npm uninstall bootstrap and the removing the import line from the index file?但是,我现在会尽力而为,您是否尝试过明显的npm uninstall bootstrap和从索引文件中删除导入行?

Let us know how it goes!让我们知道怎么回事!

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

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