Skip to content

React native 0.78 compatibility #179

@cristiammercado

Description

@cristiammercado

Describe the bug
Hi,

I'm in the process of migrating to React Native 0.78.0 and React 19, and there appear to be compatibility issues with the library in version 5.1.1.

To Reproduce

import {Directions, SpatialNavigation} from 'react-tv-space-navigation';

import {LoggerService} from './logger.service.ts';
import {remoteControlService} from './remote-control.service.ts';
import {SupportedKeysEnum} from '../model/enums/supported-keys.enum.ts';

export class SpatialNavigationService {

  private constructor() {
  }

  public static init(): void {
    SpatialNavigation.configureRemoteControl({
      remoteControlSubscriber: (callback) => {
        const mapping: { [key in SupportedKeysEnum]: Directions | null } = {
          [SupportedKeysEnum.Right]: Directions.RIGHT,
          [SupportedKeysEnum.Left]: Directions.LEFT,
          [SupportedKeysEnum.Up]: Directions.UP,
          [SupportedKeysEnum.Down]: Directions.DOWN,
          [SupportedKeysEnum.Enter]: Directions.ENTER,
          [SupportedKeysEnum.Back]: null
        };

        const remoteControlListener = (keyEvent: SupportedKeysEnum): void => callback(mapping[keyEvent]);

        return remoteControlService.addKeydownListener(remoteControlListener);
      },
      remoteControlUnsubscriber: (remoteControlListener): void => {
        remoteControlService.removeKeydownListener(remoteControlListener);
      },
    });

    LoggerService.info(`[SpatialNavigationService] Initialized spatial navigation service on TV`);
  }

}
<SpatialNavigationDeviceTypeProvider>
  <SpatialNavigationRoot isActive={true}>
    <SpatialNavigationView direction='vertical' style={styles.container}>
      <MyAppComponent/>
    </SpatialNavigationView>
  </SpatialNavigationRoot>
</SpatialNavigationDeviceTypeProvider>

Expected behavior
Application continues to work as it normally did in previous versions of React native (in my case 0.76.5).

Screenshots

Image

Image

Image

Version and OS

  • Library version: 5.1.1
  • React Native version: 0.78.0
  • OS: Android

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:HighsupportThe library lacks support for a dependency / external library version

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions