react-native-material-kit icon indicating copy to clipboard operation
react-native-material-kit copied to clipboard

Not working with react-native 0.60

Open JerakRus opened this issue 4 years ago • 16 comments

Building ios filed with error : 'No visible @interface for 'RCTEventDispatcher' declares the selector 'sendInputEventWithName:body:'"

Has anyone found a solution?

JerakRus avatar Jul 15 '19 12:07 JerakRus

Related: https://github.com/facebook/react-native/pull/15894/files

siderakis avatar Jul 16 '19 12:07 siderakis

Yes. Should we expect changes in this library, and if not, how can it be used with RN 0.60?

JerakRus avatar Jul 16 '19 13:07 JerakRus

Expect nope, but if someone send a PR I can merge it and release a new version ;)

Crash-- avatar Jul 16 '19 13:07 Crash--

This seems to fix the issue.

- (void)sendTouchEvent:(NSString*)type touch:(UITouch*)touch source:(MKTouchable*)source
{
    CGPoint location = [touch locationInView:source];
    NSDictionary *body = @{
                           @"target": source.reactTag,
                           @"type": type,
                           @"x": [NSNumber numberWithFloat:location.x],
                           @"y": [NSNumber numberWithFloat:location.y],
                           };
    
    RCTComponentEvent *event = [[RCTComponentEvent alloc] initWithName:@"topChange"
                                                               viewTag:source.reactTag body:body];
    
                                
    [self.bridge.eventDispatcher sendEvent:event];
}

siderakis avatar Jul 16 '19 23:07 siderakis

@siderakis Great thank you! Can you make a PR?

Crash-- avatar Jul 17 '19 06:07 Crash--

The real fix for this is to actually replace the offending line with:

[self.bridge enqueueJSCall:@"RCTEventEmitter" method:@"receiveEvent" args:@[dict[@"target"], RCTNormalizeInputEventName(@"topChange"), dict] completion:NULL];

ls-kelsey-regan avatar Jul 30 '19 18:07 ls-kelsey-regan

I've submitted a PR for this: https://github.com/xinthink/react-native-material-kit/pull/416

ls-kelsey-regan avatar Jul 30 '19 18:07 ls-kelsey-regan

The version of publish is not working with react-native 0.60! Has the latest version been released to fix this problem?

innocces avatar Aug 08 '19 07:08 innocces

The version of publish is not working with react-native 0.60! Has the latest version been released to fix this problem?

Nope. Use this package from the master branch directly.

Crash-- avatar Aug 08 '19 07:08 Crash--

The version of publish is not working with react-native 0.60! Has the latest version been released to fix this problem?

Nope. Use this package from the master branch directly.

How soon is the new version expected to be released?

innocces avatar Aug 08 '19 07:08 innocces

The version of publish is not working with react-native 0.60! Has the latest version been released to fix this problem?

Nope. Use this package from the master branch directly.

How soon is the new version expected to be released?

this is much needed...

marcoj avatar Aug 21 '19 10:08 marcoj

Just use the master branch instead of the npm version and it will work

Crash-- avatar Aug 21 '19 10:08 Crash--

Just use the master branch instead of the npm version and it will work

but if I do that (by adding "react-native-material-kit": "https://github.com/xinthink/react-native-material-kit" to package.json) I get this error:

the package `/Users/<user.name>/Projects/<project.name>/node_modules/react-native-material-kit/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/<user.name>/Projects/<project.name>/node_modules/react-native-material-kit/lib/index.js`. Indeed, none of these files exist:
* `/Users/<user.name/Projects/<project.name>/node_modules/react-native-material-kit/lib/index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/<user.name/Projects/<project.name>/node_modules/react-native-material-kit/lib/index.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`

marcoj avatar Aug 21 '19 11:08 marcoj

The issue is that package.json is pointing to lib/index.js which isn't checked in, and has to be compiled.

cd node_modules/react-native-material-kit
yarn install
yarn build

will create lib/index.js

siderakis avatar Sep 06 '19 02:09 siderakis

@siderakis could you submit a PR with your fork to merge it into master so we can use this repo instead of yours ? 😁

andreifilip123 avatar Oct 18 '19 13:10 andreifilip123

Our project relies on MKButton.button & MKButton.Builder()
however seems this project was rewritten using TypeScript recently, and some builders / components are gone from this commit .
😢 Finally I found https://github.com/muhammadarsal/react-native-material-kit/tree/improvements works for me.
it is based on react-native-material-kit 0.5.1 and fixed errors in RN 0.60 / 0.61

lgh06 avatar Dec 31 '19 04:12 lgh06