Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/441.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 根据日历中所需的操作嵌套ReactJS组件的最佳方法是什么_Javascript_Reactjs - Fatal编程技术网

Javascript 根据日历中所需的操作嵌套ReactJS组件的最佳方法是什么

Javascript 根据日历中所需的操作嵌套ReactJS组件的最佳方法是什么,javascript,reactjs,Javascript,Reactjs,我有一个关于在ReactJS中嵌套组件的最佳方法的问题。 我当前的嵌套看起来像下面的代码: - MainComponent <- class component - CalendarHeader <- functional component(this contains the chevrons, month and year functional components) - 7 inactive buttons( L, M, M, J, V, S, D) <- f

我有一个关于在ReactJS中嵌套组件的最佳方法的问题。
我当前的嵌套看起来像下面的代码:

- MainComponent <- class component
   - CalendarHeader <- functional component(this contains the chevrons, month and year functional components)
   - 7 inactive buttons( L, M, M, J, V, S, D) <- functional components(derived from CalendarButton)
   - 35 to 42 CalendarButtons <- functional component(these are created based on a array 
                                                      days = [29, 30, 31, 1, 2, ... 29, 30, 31, 1, 2])

-main组件可能影响答案的一件事是您是否希望一次显示多个操作组件。如果只能有一个ActionComponent,则您可能希望它位于更高的级别,这样显示或不显示它的逻辑将更易于编写。一次只能有一个ActionComponent,但始终位于按下按钮的下一行的下方。比如说:我按第3天,我的ActionComponent出现了,然后我按19。第一个ActionComponent关闭,在第19行下方显示另一个ActionComponent(或者相同但参数不同)。现在我已经解释了这一点,这两个组件可以同时设置动画吗?