mirror of
https://github.com/owncast/owncast.git
synced 2025-11-01 02:44:31 +08:00
Remove usage of the PropTypes dependency (#2723)
* Remove usage of the PropTypes dependency * Prettified Code! --------- Co-authored-by: dhanusaputra <dhanusaputra@users.noreply.github.com>
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
// TODO: add a notication after updating info that changes will take place either on a new stream or server restart. may be different for each field.
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { useState, useEffect, FC, ReactElement } from 'react';
|
||||
|
||||
import { STATUS, fetchData, FETCH_INTERVAL, SERVER_CONFIG } from './apis';
|
||||
import { ConfigDetails, UpdateArgs } from '../types/config-section';
|
||||
@ -101,7 +100,11 @@ export const ServerStatusContext = React.createContext({
|
||||
setFieldInConfigState: (args: UpdateArgs) => null,
|
||||
});
|
||||
|
||||
const ServerStatusProvider = ({ children }) => {
|
||||
export type ServerStatusProviderProps = {
|
||||
children: ReactElement;
|
||||
};
|
||||
|
||||
const ServerStatusProvider: FC<ServerStatusProviderProps> = ({ children }) => {
|
||||
const [status, setStatus] = useState(initialServerStatusState);
|
||||
const [config, setConfig] = useState(initialServerConfigState);
|
||||
|
||||
@ -164,8 +167,4 @@ const ServerStatusProvider = ({ children }) => {
|
||||
);
|
||||
};
|
||||
|
||||
ServerStatusProvider.propTypes = {
|
||||
children: PropTypes.element.isRequired,
|
||||
};
|
||||
|
||||
export default ServerStatusProvider;
|
||||
|
||||
Reference in New Issue
Block a user