[GH-ISSUE #72] Crash #40

Closed
opened 2026-05-05 11:31:14 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @mischnic on GitHub (Mar 29, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/72

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:

d4d9760d97/src/components/DesktopComponent.js (L151-L153)

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)
Originally created by @mischnic on GitHub (Mar 29, 2018). Original GitHub issue: https://github.com/kusti8/proton-native/issues/72 Code: ```jsx 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 ```js console.log(this, prop, this.eventParameter, translatedProp) ``` before the if statement here: https://github.com/kusti8/proton-native/blob/d4d9760d977908af1076e719f6624b4510d39c04/src/components/DesktopComponent.js#L151-L153 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) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/proton-native#40
No description provided.