react-native-material-kit: Button Does Not Work (Native component for "MKTouchable"/"Tickview" does not exist)

When running I receive the 2 warnings mentioned in the subject and the button does not react when clicked: no visual feedback and the console.log in the onPress event is not executed. (I tried on iOS simulator).

I used the following code copy pasted from the documentation example:

const MK = require('react-native-material-kit');
const {
  MKButton,
  MKColor,
  MKTouchable
} = MK;
...
<MKButton
            backgroundColor={MKColor.Red}
            shadowRadius={2}
            shadowOffset={{width:0, height:2}}
            shadowOpacity={.7}
            shadowColor="black"
            onPress={() => {
              console.log('hi, raised button!');
            }}
            >
            <Text pointerEvents="none"
                  style={{color: 'red', fontWeight: 'bold',}}>
              RAISED BUTTON
            </Text>
          </MKButton>

Warnings:

ExceptionsManager.js:78Warning: Native component for "MKTouchable" does not existreactConsoleError @ ExceptionsManager.js:78console.error @ YellowBox.js:49warning @ warning.js:42requireNativeComponent @ requireNativeComponent.js:53(anonymous function) @ MKTouchable.js:62requireImpl @ require.js:61require @ require.js:21(anonymous function) @ Ripple.js:12requireImpl @ require.js:61require @ require.js:21(anonymous function) @ IconToggle.js:20requireImpl @ require.js:61require @ require.js:21(anonymous function) @ index.js:5requireImpl @ require.js:61require @ require.js:21(anonymous function) @ index.js:7requireImpl @ require.js:61require @ require.js:21(anonymous function) @ screen-lovers-profile.js:3requireImpl @ require.js:61require @ require.js:21(anonymous function) @ main.js:9requireImpl @ require.js:61require @ require.js:21(anonymous function) @ index.ios.js:4requireImpl @ require.js:61requireImpl @ require.js:29require @ require.js:21(anonymous function) @ index.ios.js.js:1messageHandlers.executeApplicationScript @ debuggerWorker.js:18onmessage @ debuggerWorker.js:33

ExceptionsManager.js:78Warning: Native component for "TickView" does not exist

Any ideas?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16

Most upvoted comments

Works great with Redux. And made to do so. Hope this helps you @AndrewHenderson https://habd.as/awesome-react-boilerplates

If anyone else reads this chain, I resolved it by rebuilding my Xcode project and the linking took care of the rest. As others have mentioned, the linking doesn’t take effect until you rebuild.

@AndrewHenderson I think that’s more appropriate on StackOverflow. You’re much more likely to get a constructive response sooner there.

Fixed. Thanks @Crash-- . I had to relaunch React Packager during the process @Crash-- has recommended, and I wonder if it has anything to do with the problem.

Be sure to have linked the project.

The easiest way is to install rnpm then in your project you have to run : rnpm link

Or by doing rnpm link react-native-material-kit