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

Crash #72

Closed
mischnic opened this issue Mar 29, 2018 · 0 comments
Closed

Crash #72

mischnic opened this issue Mar 29, 2018 · 0 comments

Comments

@mischnic
Copy link
Contributor

Code:

class Notepad extends Component {
  state = { text: ''};

  render() {
    return (
      <App onShouldQuit={() => console.log('Quitting')}>
        <Window title="Test" size={{ w: 500, h: 500 }}>
            <TextInput onChange={text => this.setState({text})} multiline={true}>
              {this.state.text}
            </TextInput>
        </Window>
      </App>
    );
  }
}

I added

console.log(this, prop, this.eventParameter, translatedProp)

before the if statement here:

const translatedProp = functionMappings[prop]; // translate React function names in libui names
if (typeof this.eventParameter[translatedProp] === 'function') {
// if we don't have a translatedProperty, then we use a function, so handle that

Error message:

App {
  children:
   [ MenuBar {
       children: [Array],
       root: [Root],
       props: [Object],
       element: [UiMenu] },
     Window { children: [Array], root: [Root], props: [Object] } ],
  root: Root { children: [ [Circular] ] },
  props:
   { onShouldQuit: [Function: onShouldQuit],
     children: [ [Object], [Object] ] },
  element: {} } 'onShouldQuit' undefined undefined

The above error occurred in the <APP> component:
    in APP (created by Notepad)
    in Notepad

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
/Users/niklas/Desktop/DEV-TEST/libui/proton-native/node_modules/react-reconciler/cjs/react-reconciler.development.js:6780
      throw _error4;
      ^

TypeError: Cannot read property 'undefined' of undefined
    at _loop (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/src/components/DesktopComponent.js:153:22)
    at App.update (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/src/components/DesktopComponent.js:147:32)
    at commitUpdate (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/src/reconciler/index.js:92:18)
    at commitWork (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/node_modules/react-reconciler/cjs/react-reconciler.development.js:5045:15)
    at commitAllHostEffects (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/node_modules/react-reconciler/cjs/react-reconciler.development.js:5706:13)
    at Object.invokeGuardedCallback$1 (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/node_modules/react-reconciler/cjs/react-reconciler.development.js:1562:10)
    at invokeGuardedCallback (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/node_modules/react-reconciler/cjs/react-reconciler.development.js:1509:29)
    at commitRoot (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/node_modules/react-reconciler/cjs/react-reconciler.development.js:5801:9)
    at performWorkOnRoot (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/node_modules/react-reconciler/cjs/react-reconciler.development.js:6803:42)
    at performWork (/Users/niklas/Desktop/DEV-TEST/libui/proton-native/node_modules/react-reconciler/cjs/react-reconciler.development.js:6753:7)
@kusti8 kusti8 closed this as completed in 53a82c3 Mar 30, 2018
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

No branches or pull requests

1 participant