Annotation Interface PostMount
Identifies a method that is called after a view is mounted or attached to the DOM.
There may be zero or more methods annotated with this annotation in a view.
This method is invoked in the "commit" phase using reacts
componentDidMount() lifecycle method.
The same method may participate in several lifecycle phases by carrying their annotations. Callbacks run in declaration order, with superclasses before subclasses. Each type's interfaces are visited before its declarations, in written order with interface ancestors first and shared ancestors visited once. The first ancestor annotation for each phase reserves its position. Overrides retain that position but participate only in phases annotated on the overriding declaration; an unannotated override disables the callback. A newly added phase takes the overriding declaration's position.
The method must also conform to the following constraints:
- Must have 0 parameters
- Must not return a value
- Must not be private
- Must not be static
- Must not be abstract
- Must not throw exceptions
- Must be accessible from the same package as the class annotated by
View -
Should not be public as not expected to be invoked outside the view. A warning will be generated but can
be suppressed by the
SuppressWarningsorSuppressReact4jWarningsannotations with a key "React4j:PublicMethod". This warning is also suppressed by the annotation processor if it is implementing an interface method. -
Should not be protected if in the class annotated with the
Viewannotation as the method is not expected to be invoked outside the view. A warning will be generated but can be suppressed by theSuppressWarningsorSuppressReact4jWarningsannotations with a key "React4j:ProtectedMethod".