viewof doesn't work in the observable framework

the syntax viewof is not recognized in the md file of a observale framework project.

Example code:

```js
viewof selection = Inputs.table(penguins,{required:false})

this throws an error 
SyntaxError: Unexpected token (1:7)

Is there a difference in how we use viewof in Observable notebook vs Observable framework?

Yes, there is! viewof has always been a strange thing to grasp, so in Framework, we now use view. You can read more about this in the Framework documentation.

So instead of

viewof selection = Inputs.table(penguins,{required:false})

you would write

const selection = view(Inputs.table(penguins,{required:false}))
1 Like

It works! Thank you

1 Like