Callbacks
suggest changeHyperloop supports the React lifecycle callbacks with an Active Record-style syntax:
class SomeCallBacks < Hyperloop::Component
before_mount do
# initialize state; this replaces the usual initialize method
end
after_mount do
# the generated DOM node and window are available here
end
before_unmount do
# cleanup, such as canceling timers
end
# or name a method:
before_mount :do_some_more_initialization
end
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents