<!-- Documentation snapshot: package 5.0.0-beta.1; channel latest; archived channel next; base revision b06750c507494441f0b2298766b70087e45346a2; local changes false; original source SHA-256 8aaf72a68997636ef31de752f45110222104a5dc0e7e884a104e462cee7cda9c. -->

# MN0007: region view destroyed

Status: active
Objects: Region, View
Category: lifecycle
Severity: error

## Remediation

Create a new View instance instead of attempting to show a destroyed view.

[Region](/docs/region/) · [View](/docs/view/)

[Troubleshoot by symptom](/troubleshooting/)

## Failing and corrected example

Destruction ends a View's lifetime. Create another instance for a new screen.

<!-- troubleshooting-example: MN0007 -->
```javascript
import { Region, View } from 'marionette';

const region = new Region({ el: document.createElement('main') });
const old = new View({ template: () => 'Old' });
old.destroy();
export function fail() { region.show(old); }
export function fix() {
  region.show(new View({ template: () => 'New' }));
  return region.currentView.el.textContent;
}
export function cleanup() { region.destroy(); }
```

`fail()` throws MN0007. `fix()` returns `New`. A stopped Application may restart;
a destroyed View may not. See [View destruction](https://github.com/marionettejs/marionette/blob/9404b1935b855e05c982f697d8471764a140e8f6/docs/view.lifecycle.md).

[Example source and checks](/troubleshooting/) · [Supplement source identity](/development/manifest.json)

<!-- Supplemental example source: docs/troubleshooting.md; revision 9404b1935b855e05c982f697d8471764a140e8f6; source SHA-256 8d71b26a80ddb1ebcf0fe8fe424f94aaa3093cc743829911c677d7dc2b024c01. Catalog provenance identifies the diagnostic separately. -->

[Diagnostic catalog](/errors/index.md) · [Source identity](/docs/manifest.json)


[Canonical source](/docs/markdown/config/diagnostics/catalog.json) · [Source identity](/docs/manifest.json)
