Categories
CMS Mastering Development Wordpress

Gutenberg get withState variable in save function

I’m not very familiar with React and Redux. I have a problem with Gutenberg to get the value of the withState variable within the save function. Here’s my code: edit( {attributes, setAttributes, className} ) { var link_text = attributes.link_text; var link_url = attributes.link_url; var svg_url = attributes.svg_url; var template_url = ww_blocks.templateUrl; var hasExternalURL = attributes.hasExternalURL; […]

Categories
Mastering Development

HTML + CSS | Issue with main content not overlapping with nav bar

I have a main content area, which I want to be centered in the page both vertically and horizontally. I added a css nav bar, but now the page has scroll bars both vertically and horizontally, and the main div is no longer centered. It appears to be moved to the right and down by […]

Categories
CMS Mastering Development Wordpress

Saving Metadata from the Gutenberg Editor Sidebar to the Database

In the saga so far, you can see my First post/question Second post/question This is my third (and hopefully final) question. I’ve got everything working except for saving the data in the WP database. Incidentally, this tutorial is a goldmine for an understanding of how things work in the new Gutenberg way, and how all […]

Categories
Mastering Development

JSX element type ‘Location’ is not a constructor function for JJSX elements

I’m building app by using react and typescript. “react”: “^16.12.0”, “typescript”: “^3.7.5”, “@types/react”: “^16.9.23” I want to call my react component like that: <Location location={location} setLocation={setLocation} /> but i get this error message: TS2605: JSX element type ‘Location’ is not a constructor function for JSX elements. ¬†¬†Type ‘Location’ is missing the following properties from type […]

Categories
Development

Why is this React Typescript app throwing errors?

I just created a new React app using npx create-react-app my-app –template typescript and it was working fine until I changed my component to from a stateless one to a stateful one. The error: JSX element type ‘App’ is not a constructor function for JSX elements. TS2605 3 | import App from “./App”; 4 | […]

Categories
CMS Development Wordpress

WordPress Gutenberg-Block with ESNext (withState, withSelect)

I’m new in developing Gutenberg-Blocks with ReactJS for WordPress. At the moment I’m developing a block which contains all entries of my custom post type. The entries should be shown as a select-box in the block. But I’ve got some problems with saving the selected value. After saving and reloading the page, the select-box shows […]

Categories
Development

Coverting user from anonymous firebase, but won’t refresh screen flutter

I have setup the convert user code below: When I enter an email and password and click register, firebase makes the change but the screen won’t go to the ProfileScreen, it just stays on loading. Once I hot restart the app, it shows the correct page. //create User object based on firebase user User _userFromFirebaseUser(FirebaseUser […]