The filename is not really relevant. You should check block.json to see where the file is actually being used. I would guess that it’s being used for the viewScript
property, in which case you can check its purpose by looking for the documentation for that property, rather than anything about “view.js” alone.
As noted in the documentation, the viewScript
file is a script that will be loaded on the front end when the block is used. This is where any interactivity your block might have would be implemented if it’s not relevant in the editor.
Related Posts:
- How to trigger JS in gutenberg page load
- Change order/position of Gutenberg inspector control panel
- Gutenberg Inspector Controls
- serialize_blocks breaking html tags in content
- How to use getBlockIndex
- How to add code to `head` with WordPress 5.9 FSE (Full Site Editing)
- Block Editor: add an aria-label to an option inside a SelectControl
- Gutenberg: Get All Attributes From «core/image» Block
- How to make the Preview button automatically open new tab?
- Where on Github, or elsewhere, can I find the code for core-blocks?
- Gutenberg translation is not working
- How to add javascript function in the “save()” of gutenberg block?
- How to check if current admin page is Gutenberg editor? [duplicate]
- Possible add color palette for a block’s inner div instead of outer?
- Programmatically trigger the gutenberg save
- Gutenberg : in the backend, I just want to store a JSON object
- wordpress gutenberg url popover custom options
- Text Editors Are Hiding Text
- Disabling deleting reusable blocks except on the reusable block manager
- Gutenberg remove Most Used group
- Gutenberg. How To Register A Custom Block Style For Specific Post Type Only
- get used blocks in post and detect changing
- How to know whether you are editing a page or a post?
- How has my WordPress editor become so basic? Cannot add blocks or see anything visual
- Block Validation Fails: ‘
- Insert SVG code (not img) in HTML block
- Controlling the RichText component outside of blocks
- Custom Gutenberg Block: How to return plain HTML with save(), without escaping?
- Removing advanced section from brand new gutenberg block
- How to allow to add gradients to core/heading block?
- Gutenberg: How to update associated Terms of Custom Taxonomy to Current Post
- Gutenberg: How to float core table block in front-end of site?
- Guttenberg Implementation on Front Page
- Register multiple styles / scripts in register_block_type
- How to automatically remove noreferrer from targetd link rel attribute, on render?
- Should there be concern about breaking Gutenberg updates to extended core blocks?
- How do I access onMerge, onReplace, onRemove functions for a Rich Text component in Gutenberg block code?
- How can Reusable Blocks be fully deleted?
- Make a Gutenberg Block that do WP_User_Query
- Extend Gutenberg block core/quote block
- How to get all attributes of a block in PHP?
- reload the gutenberg editer on taxonomy change
- WordPress block editor embeds not working in theme (single.php)
- Cannot enable Gutenberg editor [closed]
- Remove ‘type / to choose a block’ placeholder [duplicate]
- Start a line with – without converting to list
- Quickest way of developing custom Gutenberg Blocks
- gutenberg attributes
- How to register two blocks in the same plugin
- Gutenberg: always show text color selector in editing bar
- How to lock innerBlocks within a block variation?
- How to fix: “The editor has encountered an unexpected error”?
- Compile a blocks src directory and main index.js entry file and output to different build dirs?
- Proxy External API request in PHP from Edit.js in Block Plugin
- How do I stop a dynamic Gutenberg component from re-rendering on every keystroke?
- Leave focus on custom Gutenberg block when pressing enter
- WordPress does not hide content after “Read more” block added using gutenberg editor
- Gutenberg InnerBlocks allowed types and reusable blocks
- Issue with translation – Gutenberg
- RSS feed WP widget vs Gutenberg Block?
- Gutenberg editor failing to load correctly after new theme install
- Gutenberg Custom Style problem with background image
- Theme options missing from edit page
- How to activate a new prop that a block introduces in a new release?
- “Updating failed” if any text includes “$v()”
- Disable Font Size for Authors using: add_theme_support(‘disable-custom-font-sizes’);
- Multiple checkboxes Gutenberg control
- Block validation failed
- Loading column block style seperately
- wp-scripts start build hangs
- How to use react in frontend of dynamic blocks?
- How to use isSavingNonPostEntityChanges in the same scope correctly?
- Attempting to specify viewScript, in a custom block, results in a register_block_script_handle error
- What is the standard way to use the version of React that ships with Gutenberg on the front end?
- Restricting core block nested blocks
- Is is possible to use Templates with blockprops?
- How to add readable name and description to templates?
- Errror generated in console leading to block validation failer
- Add Custom Block Supports to Core Block
- Block validation failed – save content vs post body content
- How to propegate changes from block render_callback to other blocks using that callback?
- wordpress 6.2 is alignfull and lignwide removed?
- How to add “rel=nofollow” for links in latest version of WordPress?
- I can’t highlight/select text in the RichText components in my Gutenberg blocks
- Lazy load video block while keeping autoplay
- Is it possible to add custom Components in the InspectorControls to the new “Styles” Tab?
- How to implement Mapbox GL JS with a custom Gutenberg block in FSE?
- Hard code block with nested block in front-page.html template
- Use a custom block inside another custom block
- Controlling or disabling Gutenberg editor panning/focus on a custom slider block
- Default value for highorder component in Gutenbrg?
- Custom gutenberg block: window.wp.blockEditor returns undefined
- How can I add a wrapper class to individual blocks inside of an InnerBlocks component?
- how can I remove all default settings in Gutenberg blocks? example core/button
- How do i create a switch for responsive devices?
- wordpress 6.4.2 gutenberg custom block array attributes saving problem?
- Modifying other core editor panels besides Featured Image in the block editor
- Theme.json: styles.typography.FontFamily renders as default font in front end but not editor
- Detecting whenever a user types – in the Gutenberg editor, and checking if there is a preceding or succeeding – then converting both to an em dash
- Setting “Open in New Tab” for Link Control to be checked by default