How do you perform conditional rendering in functional components in React?

Typically I would do this: render() { const isLoggedIn = this.state.isLoggedIn; return ( <div> {isLoggedIn ? ( <LogoutButton onClick={this.handleLogoutClick} /> ) : ( <LoginButton onClick={this.handleLoginClick} /> )} </div> ); } … but obviously I can’t use this code inside a functional component export const LoginContainer = () { {if <– CRASH! } What is the…

Details

WordPress.com REST endpoint for /wp-json/wp/v2

The REST endpoint /wp-json/wp/v2 is available for self-hosted WP blogs. Where do I find this endpoint for blogs that run on WordPress.com? I tried https://public-api.wordpress.com/wp/v2/sites/example.wordpress.com/wp-json/wp/v2 but it returns this error: {“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method”,”data”:{“status”:404}}

Details

Problem with building the CGAL 5.0 demo GraphicsView

I’ve installed the CGAL 5.0 on my Ubuntu 18.04.3 box (into my home directory) and tried to build some visualization demos – no success. For example the demo directory <my CGAL root>/demo/GraphicsView contains the following CMakeLists.txt file: # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1…3.15) project (GraphicsView_Demo) if(NOT POLICY CMP0070…

Details