I'm able to apply some GSAPI effects to dynamically generated graphics by placing the required code in componentDidMount() in a React-based application.
I've tried using a Promise and placing the same code in the 'next' method, but it seem to execute "too early" so the GSAPI effects are not created.
Suggestions welcome:)
The componentDidMount() method is called after the component is rendered. This is where you run statements that requires that the component is already placed in the DOM.
The componentDidUpdate()is called after componentDidMount() and can be useful to perform some action when the state of the component changes. Parameters: Following are the parameter used in this function: prevProps: Previous props passed to the component. prevState: Previous state of the component.
You are now ready to use the GoodData React Components in your Angular app. You can use wrapped components across your app. You can pass the component props to it and even update them using data-binding.
React is a library, but Angular is a full-fledged framework. The virtual DOM and one-way data binding are used by React. js, but the real DOM and two-way data binding are used by Angular. There's also a speed difference (React's is faster) and a difference in bundle size (React's is smaller) (React works a bit faster).
@Oswald I think you are doing some manipulation of DOM after component is rendered so ngAfterContentInit
seems to be appropriate for this case.
There are other lifecycle methods available as well. Have a look here: https://angular.io/docs/ts/latest/guide/lifecycle-hooks.html#!#hooks-overview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With