react-native-material-kit
react-native-material-kit copied to clipboard
Not working with react-native 0.60
Building ios filed with error : 'No visible @interface for 'RCTEventDispatcher' declares the selector 'sendInputEventWithName:body:'"
Has anyone found a solution?
Related: https://github.com/facebook/react-native/pull/15894/files
Yes. Should we expect changes in this library, and if not, how can it be used with RN 0.60?
Expect nope, but if someone send a PR I can merge it and release a new version ;)
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 Great thank you! Can you make a PR?
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];
I've submitted a PR for this: https://github.com/xinthink/react-native-material-kit/pull/416
The version of publish is not working with react-native 0.60! Has the latest version been released to fix this problem?
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.
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?
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...
Just use the master branch instead of the npm version and it will work
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)`
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 could you submit a PR with your fork to merge it into master so we can use this repo instead of yours ? 😁
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