Skip to content
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

MIgrating to New Architecture #716

Closed
salisuabubakar opened this issue Sep 11, 2023 · 17 comments · Fixed by #717
Closed

MIgrating to New Architecture #716

salisuabubakar opened this issue Sep 11, 2023 · 17 comments · Fixed by #717

Comments

@salisuabubakar
Copy link

salisuabubakar commented Sep 11, 2023

Hi,
Am having some challenges migrating my app to the new artchitecture. When i try to build using xcode i get this error

No matching constructor for initialization of 'facebook::react::NVTabBarItemState'.

Below is the file that i get the error on:

#pragma once

#include "NVTabBarItemState.h"
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
#include <react/renderer/components/navigationreactnative/EventEmitters.h>
#include <react/renderer/components/navigationreactnative/Props.h>
#include <react/renderer/imagemanager/ImageManager.h>

namespace facebook {
namespace react {

JSI_EXPORT extern const char NVTabBarItemComponentName[];

class JSI_EXPORT NVTabBarItemShadowNode final: public ConcreteViewShadowNode<
  NVTabBarItemComponentName,
  NVTabBarItemProps,
  NVTabBarItemEventEmitter,
  NVTabBarItemState
> {

public:
  using ConcreteViewShadowNode::ConcreteViewShadowNode;

  void setImageManager(const SharedImageManager &imageManager);

  static NVTabBarItemState initialStateData(
                                           ShadowNodeFragment const &fragment,
                                           ShadowNodeFamilyFragment const &familyFragment,
                                           ComponentDescriptor const &componentDescriptor) {
    auto imageSource = ImageSource{ImageSource::Type::Invalid};
    return {
      imageSource,
      {imageSource, nullptr}};
  }

#pragma mark - LayoutableShadowNode

  Size measureContent(
                      LayoutContext const &layoutContext,
                      LayoutConstraints const &layoutConstraints) const override;
  void layout(LayoutContext layoutContext) override;

private:
  void updateStateIfNeeded();

  ImageSource getImageSource() const;

  SharedImageManager imageManager_;
};

} // namespace react
} // namespace facebook

Kindly check if its something you can help me resolve.

Thanks

@grahammendick
Copy link
Owner

Hey, I've got a fabric sample that runs off the new architecture.

Can you check you can run this, please?

@salisuabubakar
Copy link
Author

Hi,
Thanks for the quick response. I have tried the sample fabri new architecture but i have this error stated above when i try to run my app.

@grahammendick
Copy link
Owner

Can you successfully run the fabric sample from this repo on iOS and Android?

@salisuabubakar
Copy link
Author

image

@grahammendick
Copy link
Owner

I want to know if you get an error when you run the fabric sample in this repo.
Please can you clone this repository, run the fabric sample and let me know what happens.

@salisuabubakar
Copy link
Author

Hi, Yes i have run it before and i didnt have any issue. Thanks

@grahammendick
Copy link
Owner

Ok, then you've probably not upgraded your project to the new architecture quite right.
Why don't you create a brand new project on the new architecture, make sure it runs and then copy your files from the old project to the new one?

@salisuabubakar
Copy link
Author

Sure. I think thats a good idea. Thanks soo much. Really appreciate your time and support. Am very proud to say all the apps i built using the navigation router works perfect. Its hard to deferentiate between that of a native app. Thanks for the wonderful library one again.

@grahammendick
Copy link
Owner

Oh thank you. I'm always happy to help and it's so nice to hear that feedback. Please tell all your friends!

@grahammendick
Copy link
Owner

Are your apps public? I'd like to see what you've built

@salisuabubakar
Copy link
Author

Yes sure. Please search for Oil City Radio 95.9 on app store.

@salisuabubakar
Copy link
Author

HI, am still getting the same error. Can you please check. Thanks

@grahammendick
Copy link
Owner

Oh yea, I just tried it with the last react-native and get the same error. I'll investigate. Thanks for letting me know

@salisuabubakar
Copy link
Author

Sure. Thanks soo much. I really need it.

@grahammendick
Copy link
Owner

Think I've found the fix. If you want to try it out you need to put it in NVBarButtonShadowNode.h, NVNavigationBarShadowNode.h and NVTabBarItemShadowNode.h.

@grahammendick
Copy link
Owner

I just published the fix in navigation-react-native v9.4.2 and thanked you in the release notes

@salisuabubakar
Copy link
Author

Thanks soo much. i have update navigation-react-native to v9.4.2 and its working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants