Upgrade target to es2022 (#12852)

* Upgrade target to es2021

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Upgrade to es2022

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix babel config

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix React contexts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix types

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix React state

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2024-08-01 17:14:28 +01:00
committed by GitHub
parent 9cd0c247a2
commit c1d4199b02
68 changed files with 86 additions and 148 deletions

View File

@@ -120,7 +120,7 @@ interface IState {
export default class AppTile extends React.Component<IProps, IState> {
public static contextType = MatrixClientContext;
public context!: ContextType<typeof MatrixClientContext>;
public declare context: ContextType<typeof MatrixClientContext>;
public static defaultProps: Partial<IProps> = {
waitForIframeLoad: true,
@@ -144,7 +144,6 @@ export default class AppTile extends React.Component<IProps, IState> {
public constructor(props: IProps, context: ContextType<typeof MatrixClientContext>) {
super(props, context);
this.context = context; // XXX: workaround for lack of `declare` support on `public context!:` definition
// Tiles in miniMode are floating, and therefore not docked
if (!this.props.miniMode) {

View File

@@ -81,7 +81,7 @@ export default class EventListSummary extends React.Component<
IProps & Required<Pick<IProps, "summaryLength" | "threshold" | "avatarsMaxLength" | "layout">>
> {
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
public declare context: React.ContextType<typeof RoomContext>;
public static defaultProps = {
summaryLength: 1,

View File

@@ -32,7 +32,7 @@ interface IProps {
export default class PersistentApp extends React.Component<IProps> {
public static contextType = MatrixClientContext;
public context!: ContextType<typeof MatrixClientContext>;
public declare context: ContextType<typeof MatrixClientContext>;
private room: Room;
public constructor(props: IProps, context: ContextType<typeof MatrixClientContext>) {

View File

@@ -73,7 +73,7 @@ interface IState {
// be low as each event being loaded (after the first) is triggered by an explicit user action.
export default class ReplyChain extends React.Component<IProps, IState> {
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
public declare context: React.ContextType<typeof RoomContext>;
private unmounted = false;
private room: Room;

View File

@@ -41,7 +41,7 @@ interface IState {
// Controlled form component wrapping Field for inputting a room alias scoped to a given domain
export default class RoomAliasField extends React.PureComponent<IProps, IState> {
public static contextType = MatrixClientContext;
public context!: React.ContextType<typeof MatrixClientContext>;
public declare context: React.ContextType<typeof MatrixClientContext>;
private fieldRef = createRef<Field>();