react icon indicating copy to clipboard operation
react copied to clipboard

in component render method, how to get future container's width , height?

Open majorye opened this issue 11 years ago • 3 comments

I want to write a layout component

  <layout jsxcols="300,200,*">
         <div>
                 <layout jsxcols="100,200">
                          <div></div>
                         <div></div>
                </layout>
         </div>
         <div> width will take 200px </div>
         <div> width will take the rest width of container </div>
 </layout>

how to get the future container's width , height?

majorye avatar May 24 '15 01:05 majorye

use life cycle method componentDidMount to sync it , and already implement it here

majorye avatar May 25 '15 04:05 majorye

Looks like you answered your own question. Closing out.

zpao avatar May 26 '15 22:05 zpao

:)-

majorye avatar May 27 '15 01:05 majorye