File tree Expand file tree Collapse file tree 4 files changed +19
-12
lines changed Expand file tree Collapse file tree 4 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -54,16 +54,17 @@ const MyLoader = () => (
5454
5555## Options  
5656
57- |  Name                |  Type     |  Default         |  Description                 | 
58- |  ------------------- |  -------- |  --------------- |  --------------------------- | 
59- |  speed               |  _ Number_  |  ` 2 `              |  Animation speed             | 
60- |  width               |  _ Number_  |  ` 400 `            |  ** viewBox**  width of SVG    | 
61- |  height              |  _ Number_  |  ` 130 `            |  ** viewBox**  height of SVG   | 
62- |  style               |  _ Object_  |  ` null `           |  Ex: ` { marginTop: '50px' } `  | 
63- |  primaryColor        |  _ String_  |  ` #f3f3f3 `        |  Background the SVG          | 
64- |  secondaryColor      |  _ String_  |  ` #ecebeb `        |  Animation color             | 
65- |  preserveAspectRatio |  _ String_  |  ` xMidYMid meet `  |  Aspect ratio option of SVG  | 
66- |  className           |  _ String_  |  ''              |  Classname in the <svg  />    | 
57+ |  Name                |  Type     |  Default          |  Description                                                  | 
58+ |  ------------------- |  -------- |  ---------------- |  ------------------------------------------------------------ | 
59+ |  speed               |  _ Number_  |  ` 2 `               |  Animation speed                                              | 
60+ |  width               |  _ Number_  |  ` 400 `             |  ** viewBox**  width of SVG                                     | 
61+ |  height              |  _ Number_  |  ` 130 `             |  ** viewBox**  height of SVG                                    | 
62+ |  style               |  _ Object_  |  ` null `            |  Ex: ` { marginTop: '50px' } `                                   | 
63+ |  primaryColor        |  _ String_  |  ` #f3f3f3 `         |  Background the SVG                                           | 
64+ |  secondaryColor      |  _ String_  |  ` #ecebeb `         |  Animation color                                              | 
65+ |  preserveAspectRatio |  _ String_  |  ` xMidYMid meet `   |  Aspect ratio option of SVG                                   | 
66+ |  className           |  _ String_  |  ''               |  Classname in the <svg  />                                     | 
67+ |  uniquekey           |  _ String_  |  random unique id |  ** Use the same key value, it'll solve some problems to SSR**  | 
6768
6869### Examples  
6970
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ export type WrapProps = {
99}  &  ContentLoaderProps 
1010
1111const  Wrap  =  ( props : WrapProps ) : React . Element < * >  =>  { 
12-   const  idClip =  uid ( ) 
13-   const  idGradient  =  uid ( ) 
12+   const  idClip =  ` ${ props . uniquekey } -idClip`   ||   uid ( ) 
13+   const  idGradient  =  ` ${ props . uniquekey } -idGradient`   ||   uid ( ) 
1414
1515  return  ( 
1616    < svg 
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export type Props = {
1919  secondaryColor : string , 
2020  preserveAspectRatio : string , 
2121  className : string , 
22+   uniquekey : string , 
2223} 
2324
2425const  defaultProps  =  { 
Original file line number Diff line number Diff line change @@ -63,3 +63,8 @@ storiesOf('ContentLoader', module)
6363      < ContentLoader  width = { 400 }  height = { 150 }  /> 
6464    </ Container > 
6565  ) ) 
66+   . add ( 'unique-key: for SSR' ,  ( )  =>  ( 
67+     < Container > 
68+       < ContentLoader  uniquekey = "unique-key"  /> 
69+     </ Container > 
70+   ) ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments