Function MainContainerComponent

MainContainerComponent is a React functional component that renders a container with customizable dimensions and margins. The container's dimensions adapt to the window size based on provided width and height fractions, and it updates dynamically on window resize or orientation changes.

import React from 'react';
import { MainContainerComponent } from 'mediasfu-reactjs';

function App() {
return (
<MainContainerComponent
backgroundColor="black"
containerWidthFraction={0.5}
containerHeightFraction={0.5}
marginLeft={10}
marginRight={10}
marginTop={10}
marginBottom={10}
padding={10}
>
<ChildComponent />
</MainContainerComponent>
);
}

export default App;

Properties

propTypes?: any

Ignored by React.

Only kept in types for backwards compatibility. Will be removed in a future major release.

displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'