Skip to content

Does viewof() work in Notebook Kit? #24

Answered by mbostock
Lucas-Kohorst asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, it should work. Can you share your code, or a reproduction?

Here is an example that works in an Observable JavaScript cell:

viewof foo = Inputs.range([0, 100], {step: 1, label: "Foo"})

Of course, we highly recommend migrating to vanilla JavaScript, which would be:

const foo = view(Inputs.range([0, 100], {step: 1, label: "Foo"}));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Lucas-Kohorst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants