-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Numbers and booleans aren’t replaced correctly #106
Comments
I’ve tried to look at the source code, but I am not sure how is it supposed to work: First, in
After this, the values passed to
But there seems to be nothing to replace these placeholders now. They are directly inserted into DOM at this point. Am I doing something wrong? |
What you're seeing is a placeholder that is passing the data and its type information ( import Tonic from 'https://cdn.jsdelivr.net/npm/@socketsupply/[email protected]/+esm'
const numberValue = 1;
const booleanValue = true;
const stringValue = 'lorem ipsum';
class MyComponent extends Tonic {
render() {
return this.html`<ul>
<li>Number ${String(numberValue)}</li>
<li>Boolean ${String(booleanValue)}</li>
<li>String ${stringValue}</li>
</ul>`;
}
}
Tonic.add(MyComponent); |
Thank you! I’d be happy to contribute docs if you give me some guidance! |
Feel free to close 👍 |
I think in the getting started guide there should be a mention that says something like "anything that isn't a string type will be considered a value that you are trying to pass as a reference." |
Describe the bug
When passing a boolean or number, I am seeing the variable type in the rendered output, i.e.
Steps To Reproduce
See https://jsfiddle.net/fev3zko2/
with the following code:
This seems to happen in every browser that I tested with.
The text was updated successfully, but these errors were encountered: