mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Remove the components prop in favor of the native children prop to prevent unnecessary re-renders which are breaking component animations
This commit is contained in:
parent
51613c3020
commit
f32f30ef0a
13 changed files with 271 additions and 371 deletions
|
@ -1,16 +1,9 @@
|
|||
const SettingsBlock = ( { className, components = [], children } ) => {
|
||||
const SettingsBlock = ( { className, children } ) => {
|
||||
const blockClassName = [ 'ppcp-r-settings-block', className ].filter(
|
||||
Boolean
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={ blockClassName.join( ' ' ) }>
|
||||
{ children ||
|
||||
components.map( ( Component, index ) => (
|
||||
<Component key={ index } />
|
||||
) ) }
|
||||
</div>
|
||||
);
|
||||
return <div className={ blockClassName.join( ' ' ) }>{ children }</div>;
|
||||
};
|
||||
|
||||
export default SettingsBlock;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue