Gradle upload a custom-generated jar file to Nexus

Do this: apply plugin: ‘maven-publish’ publishing { publications { maven( MavenPublication ) { artifact theTaskThatGeneratesJar } } repositories { maven { def releasesRepoUrl = http://…/repositories/releases/’ def snapshotsRepoUrl = ‘http://…/repositories/snapshots/’ url = version.endsWith(‘SNAPSHOT’) ? snapshotsRepoUrl : releasesRepoUrl credentials { username ‘xxx’ password ‘xxx’ } } } }

React Component: A pair of componentDidMount() and componentWillUnmount() may cause infinite loop if error is thrown from render

The following will cause an infinite loop. The render() method will be called again and again. class ToDoItemEditComponentContainer extends React.Component { componentDidMount() { this.props.loadItem(); //load item remotely and put it in the local redux store } componentWillUnmount() { this.props.clearItemLocally(); //remove item from local redux store } render() { throw “some error” } } Here is …

React Component: A pair of componentDidMount() and componentWillUnmount() may cause infinite loop if error is thrown from render Read More »

My practice of fetching data for List/Detail components in React/Redux

The user experience it should have When you go to a detail page from the list page or with a direct URL, the detail page should show the up-to-date data When you go to the list page with a direct URL, the list page should show the up-to-date data When you RETURN to the list …

My practice of fetching data for List/Detail components in React/Redux Read More »

Load data from backend before rendering a React component – best practice

Where to put the data fetching code? componentWillMount() ? Not any more. It’s been deprecated. You have no choice but put it inside componentDidMount() , which is recomendded by React. However ther is a big issue. componentDidMount() is actually AFTER render(). It "works" because after componentDidMount() finishes its job and changes some state, render() will …

Load data from backend before rendering a React component – best practice Read More »