Skip to content

React native 0.78 compatibility #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cristiammercado opened this issue Mar 14, 2025 · 6 comments
Open

React native 0.78 compatibility #179

cristiammercado opened this issue Mar 14, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@cristiammercado
Copy link

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.

@cristiammercado cristiammercado added the bug Something isn't working label Mar 14, 2025
@cristiammercado
Copy link
Author

Hi @pierpo, any update about this?

@samsonroy
Copy link

Hi @pierpo any update on this ?

@vishu2124
Copy link

@pierpo - Any update on this, We are having issue with RN version 0.78, 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.

@pierpo
Copy link
Member

pierpo commented Apr 29, 2025

Hey! Sorry for not being very active on the project right now 😅
Could you help with the investigation? I do not have any time to look at it myself 😭 I'll make some time to review PRs and publish changes, but it would be lovely to get some help regarding the solution!

@robmim
Copy link

robmim commented May 1, 2025

@pierpo , The React and React-dom version seem to cause this issue. Since the latest version of expo and react-native are using version 19 and SpatialNavigation is using 18.

"@types/react": "~18.2.79",
"@types/react-dom": "~18.2.25",

@robmim
Copy link

robmim commented May 1, 2025

@pierpo Just made a PR for this. Everything is building fine but the mapping of the remote control inst working now. Why i dont know.

#185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants