Welcome to react js!, it seems like you are trying to load Redirect as if it were a function, but it's not a function! it is a React Component!! More infromation about react components: react documentation or ww3Schools.
Redirect works when you want to change the Web Site direction (as you were trying to do it), but you have to use it as a component.
You should use props.history.push() when you are using the history in one of the children of your components, but both work similar, as you can see is hard to define when you should use it because they do the similar things, some people don't care about it, but if you want to know more check this post StackOverflow: In React is it always better to render a Redirect than use this.props.history.push?
About your code, be careful with the version that you are using in react, because in React 16.8 there is a feature to use react hooks and use functional components as a react component is pretty interesting, in your case you can't control the state of the element with out using React.memo but i prefer to use React components in this case you can use something like this:
Your landing page.js
import auth from "./auth";
import { Redirect } from "react-router-dom";
export class LandingPage extends Component {
constructor(props){
super(props);
this.state = {
authenticated: false
};
}
render(){
return (
<div>
{this.state.authenticated ? (<Redirect to="/app" />) : null}
<h1>Landing Page</h1>
<button
onClick={() => {
return this.setState({ authenticated: auth.login()})
}}
>
Login
</button>
</div>
);
}
}
Your auth.js
class Auth {
constructor() {
this.authenticated = false;
}
login() {
return this.authenticated = true;
}
logout() {
return this.authenticated = false;
}
isAuthenticated() {
return this.authenticated;
}
}
export default new Auth();