I am a little late on this, but for anyone searching similar answer – in first example, I would say you did not define cwraggDataSource attribute properly (you did not provide block definition code). When attribute is not defined properly, it is initialized to undefined.
As for the second example, you were trying to call setAttributes in event function, and in it setAttributes is out of scope.
Related Posts:
- lodash dependency in a Gutenberg plugin
- creating elements/innerblocks via rangecontrol
- Looking for callback function after Gutenberg is rendered?
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Make a list with header and subtext in Gutenberg blocks
- Gutenberg – What is the best way to save/update post meta?
- How to prevent UNDO on guternberg block editor
- Do I have to worry about useState causing a re-render?
- Creating a custom Gutenberg block with columns
- Gutenberg: import dependency or assign from global variable?
- How to control an elements classes from multiple Gutenberg sidebar controls?
- Developing the save function in Gutenberg blocks
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- Rerender core Templates with with ToggleControl but it doesnt recognize block type
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- What happens/fires when you select a block in the editor?
- Is “document loaded” different on admin side than public side?
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- Reading plugin settings in esnext wordpress block
- How can i add insertion point between inner blocks in my custom block like core blocks
- Reinitiate Gutenburg’s blocks using javascript
- Insert text programmatically in WordPress Gutenberg Editor
- Javascript function defined in view.js not reachable from save.js
- How to move custom gutenberg block controls from settings to styles tab?
- How to use useSelect to retrieve the currently default fontFamily?
- Event when Modal is opened/visible
- useBlockProps() nests wrapper with class name inside block wrapper in the editor
- Is It Possible to Use the Block Editor’s Notification Feature to Send Another Notification After the Post Is Saved?
- Custom action button in Gutenberg editor (post_submitbox_misc_actions – equivalent)
- How to provide translations for a WordPress TinyMCE plugin?
- How-to implement admin Ajax inside an admin WP_List_Table?
- Include third party Javascript library which is not included in WordPress
- Create Element From Dynamic HTML String [closed]
- The changes I make to an external JS file of my WP plugin are only applied after I clear my browser’s cache
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”
- How to Parse an Array of Elements in Gutenberg Block
- Is there a better way to implement responsive images than what WordPress uses by default?
- Gutenberg registerFormatType with Multiple Classes
- Passing RichText attributes to function onChange
- Gutenberg Block add element in the Editor inside InnerBlocks after div – editor-block-list
- Prevent Javascript Facebook SDK Conflicts in plugin
- Print WordPress username id inside JavaScript
- Mixing Regular Javascript With jQuery in a Plugin
- How to create multiple Gutenberg blocks in one plugin
- How to get color name in PanelColorSettings in custom Gutenberg block?
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Where to call wp_enqueue_script in a plugin with custom template?
- Is there an additional block.json property to set to get an InnerBlocks child to respect the “supports” property?
- How to setAttributes in Gutenberg block?
- How to override gutenberg paragraph block edit property
- What’s the right way to instantiate new blocks and/or the plugin itself in toto when using wppb architecture?
- How to get boolean value from register_meta properly?
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- How can I get the selected string when using a toolbar button in Gutenberg?
- wp.template() returns tags in Ajax response
- How can I avoid conflicts between plugin and theme?
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- How to only load css for used blocks on frontend
- Additional classes `undefined` after saving post in Gutenberg
- How do you submit a Gutenberg plugin?
- Translate javascript with WordPress built-in localization API for static strings
- Invalid hook call on save, not edit when using swiper slider
- Insert Into Post Not Working For Audio File Using jQuery
- How to insert HTML/CSS/JS into my iframe plugin?
- Is there a WordPress plugin to design WebGL? [closed]
- How to write a shopping queue line plugin with a queue button?
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- How to override supports of innerBlocks?
- extraprops override existing props
- WPGut – Updating failed and shortcode?
- Fixed: Console.log twice in the edit function
- Gutenberg – Call google map render function in save after DOM has been rendered
- converting a node.js project into a wp plugin
- Where do I hook to have the server do something in PHP on block attribute change?
- WordPress with React: Saving and Using Data Collected with fetch
- How to get access the ID of all posts of custom post type in Gutenberg editor
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- Uncaught ReferenceError: kpoejy is not defined
- Remove from a div by class name from post page if post author role is not administrator
- On one of my sites a file is shown as 404 but the file IS there
- How react js and other Javascript Technologies works on WordPress plugin?
- get the queried_object of an url
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Build a dynamic block using the default attributes
- Add custom data-attribute to core Gutenberg block within an template
- How to replace content of a block in and re-render on change?
- extending a core block doesn’t work inside the editor
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development
- Remove Gutenberg Buttons Block
- Multiple php files in dynamic gutenberg block
- How to detect when the user clicks the publish/update button in Gutenberg Editor
- Gutenberg Static blocks: viewScript doesn’t import css for frontend?
- Can we write custom DOM manipulation inside edit.js file while developing custom Gutenberg block?
- User set default settings for a Block in Site Editor
- how to include an image in the build of a multi block plugin
- render_block_context filter and block context inheritance