简体   繁体   English

如何将一个 React 组件包裹在另一个组件上

[英]How can I wrap one React component around another

I am new to React.我是 React 的新手。 Basically, I have been given a HTML Bootstrap template.基本上,我得到了一个 HTML 引导模板。 It is pretty simple... a left sidebar (always present), an adjacent menu (always present) and all other components fit adjacent to side bar and under menu.这很简单......左侧边栏(始终存在),相邻菜单(始终存在)和所有其他组件都适合靠近边栏和菜单下方。 I have attached a pic so you can easily see what I mean.我附上了一张照片,所以你可以很容易地明白我的意思。

I can display the components but my dynamic components or the components that change are rendered below the sidebar and NOT next to it.我可以显示组件,但我的动态组件或更改的组件呈现在侧边栏下方而不是旁边。 布局图

I have tried to solve this issue for days... no luck.我已经尝试解决这个问题好几天了......没有运气。 Help would be greatly appreciated.帮助将不胜感激。

Thank you谢谢

Vincent文森特

It seems like a css issue, make sure you have your child divs inside the parent and nothing is position absolute.这似乎是一个 css 问题,请确保您的子 div 在父级中,并且没有什么是绝对的 position。 if you have it online I can take a look.如果你在网上我可以看看。

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

相关问题 如何将错误边界包装在获取数据的 react-table 组件周围? - How can I wrap Error Boundaries around my react-table component that fetches data? 如何包装React组件? - How can I wrap React component? 如何有条件地包装这个反应组件 - How Can I conditionally wrap this react component 我如何才能将一个组件与另一个组件进行反应 - How I can one component to another component in react 如何在另一个组件中使用一个组件的功能? (反应) - How can I use the function of one component in another component? (react) 如何将 function 从一个组件调用到另一个组件? 反应 - How can I call a function from one component to another? React 如何将 js 文件与模板文件包装并连接到一个 React 组件中? - How can I wrap and concatenate js file with template file into one React Component? 我将如何创建一个 Page 组件并将其包裹在 UserForm 组件周围 - How cwould I create a Page component and wrap it around the UserForm component 我们可以在 React 中将一个 HOC 包裹在另一个 HOC 周围吗 - Can we wrap a HOC around another HOC in React 我可以在 React 的另一个组件中重用一个组件的片段吗? - Can I reuse a Fragment from one Component in another Component in React?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM