 		rootRealizedElement?.view?.removeFromSuperview()
 		rootRealizedElement?.element.derealize()
 		hostView = nil
+		rootRealizedElement = nil
 		
 		componentDidDerealize()
 	}

	/// The state on which the component depends.
	private var state: S

	private var rootRealizedElement: RealizedElement?

	private var hostView: ViewType?

		precondition(hostView == nil, "\(self) has already been added to a view. Remove it before adding it to a new view.")

		hostView = view
		let realizedElement = realizeComponent()
		if let realizedView = realizedElement.view {
			view.addSubview(realizedView)
		}

		rootRealizedElement = realizedElement
	}

	private func realizeComponent() -> RealizedElement {
		componentWillRealize()

		update()

		let realizedRoot = realizeNewRoot(rootElement!)

		componentDidRealize()

		return realizedRoot
	}

	/// Remove the component from its host view.
