反应和引导最佳实践(我应该如何设计我的网站)
我正在React创建我的第一个网站。我想使用Bootstrap的网格系统,但是我真的不知道何时应该使用它或更广泛。
网格系统在app.js和每个组件等地方是否最好?只是在每个组件中?只是在app.js中?
I am making my first ever website in React. I want to use Bootstrap's grid system, but I don't really know when I should use this or rather how extensively.
Is the grid system best in places like App.js and in each individual component? Just in each individual component? Just in App.js?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用React-bootstrap。我发现与之相处非常简单,而您在VS代码中获得的Intellisense很棒。
首先,仅:
npm install react-bootstrap
您可以看到所有组件的列表在这里。
然后,您只需将要使用的组件添加到导入中即可。
然后在您的渲染输出中,例如:
I use React-Bootstrap. I've found it very simple to get going with, and the intellisense you get in VS Code is great.
To get started, just:
npm install react-bootstrap
You can see a list of all of the components here.
Then you just add the components that you want to use to your import.
Then in your rendered output, for example:
我们可以使用普通的引导程序来使用网格系统。我们必须根据要做的要求在大多数组件中使用它是响应迅速的。
简单选择:
还有其他选项可以使用bootstrap内部的bootstrap,例如组件库。您可以使用 react-bootstrap 。这些库提供了组件,您可以通过这些组件轻松地创建带有引导程序的React和功能的网站。
We can use plain bootstrap to use grid system. We have to use it inside most of the component according to the requirement to make is responsive.
Easy Option:
There are other options to use bootstrap inside react like component libraries. You can use either Reactstrap or React-Bootstrap. These libraries provide components by which you can easily create website with react and power of bootstrap.