question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

oncreate appears to be broken

See original GitHub issue

OnCreate seems to be broken currently. When porting a rather large application from hyperapp@0.7 to hyperapp@0.9 I experienced a crash.

Broken Code [run]

const { h, app } = hyperapp
/** @jsx h */

app({
  state: null,
  actions: {
    bug: element => element
  },
  view: (element, {bug}) => <h1 oncreate={bug}>{element ? 'yes' : 'no'}</h1>
})

Workaround [run]

const { h, app } = hyperapp
/** @jsx h */

app({
  state: null,
  actions: {
    bug: element => element
  },
  view: (element, {bug}) => <h1 oncreate={data => setTimeout(() => bug(data), 0)}>{element ? 'yes' : 'no'}</h1>
})

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:29 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
FlorianWendelborncommented, May 25, 2017

@jbucaran No, I don’t have time for OpenSource stuff right now. I’m working while being a full-time student.

1reaction
FlorianWendelborncommented, May 25, 2017

@jbucaran Sorry to quote myself again, but please re-read my last comment.

This issue isn’t about the way I store the reference to an element, that’s just an example. This issue is about hyperapp’s events breaking when using hyperapp’s own actions. There is no reason why this should break anything if I update the state. Instead, one solution would be to defer the next render until the current render is done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code in Android onCreate() method not working properly
I'm trying to make a really simple android game, and so far I have a method named startGame() which just plays a sound...
Read more >
Android build error. MainActivity.java:7: error: cannot find ...
Android build error. MainActivity.java:7: error: cannot find symbol - onCreate(Bundle savedInstanceState) #111.
Read more >
4. The Activity Lifecycle: Being an Activity - Head First Android ...
A new activity is created in its place. The activity is visible but not in the foreground. The onCreate() and onStart() methods get...
Read more >
Activity | Android Developers
onCreate(Bundle) is where you initialize your activity. Most importantly, here you will ... All of this information appears back on the parent's Activity....
Read more >
findNavController() fails in onCreate when NavHostFragment ...
But the real problem here is Android Studio showing warning for this setup suggesting to replace <fragment> with FragmentContainerView . In other words,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found